I'm searching every txt files that contains string1 and string2
grep -rnE --include='*.txt' 'string1|string2'
Now I want to put all those files into a zip file.
Thanks
EDIT this script suggest by @anubhava works for me
grep --null -rlE --include='*.txt' 'string1|string2' | xargs -0 -I {} zip test.zip '{}'