I have many files that contains many lines of data. I am trying to find a needle in a haystack in that I'm looking only for files that contain word1 AND word2.
I'm using ...
...
but this is finding files that contains word1 OR word2. No good for me. How can I grep to find both words in a single file?
file_list will have file names which contain both word1 and word2 . i.e. if the file has both word1 and word2, then that file name will be present 2 times in the file_list.
uniq will give the count. So if the count is 2 or more, then it means both the words are present.