I'm trying to find all files that contain 2 specific strings. It needs to match both string1 AND string2. What I've tried so far:
find ~ -type f -name "*.txt" -exec grep -lie 'string1' -lie 'string2' {} \; But this seems to find string1 OR string2. How can I find all files containing both string1 AND string2?
In this specific case, I'm trying to find all documents that contain both strings 'sed' and 'lynx'
find ~ -type f -name "*.txt" -exec grep -lie 'sed' -lie 'lynx' {} \;