I would like to list the files (using
grep -r) that have both of the two keywords (not necessarily on the same line):
When I do the following, I get the files that have
grep -r 'word1\|word2' .
I also tried the following:
grep -r 'word1|word2'
which does not return anything, but I'm not sure if it's because there are no files that have both these keywords, or there are no files that have both these keywords on the same line.
How can I get the list of files that contain the two keywords somewhere in the file?