How can I make use of grep in cygwin to find all files that contain BOTH words.
This is what I use to search all files in a directory recursively fo
The uses PCRE (Perl-Compatible Regular Expressions) with multiline matching and returns the filenames of files that contain both strings (AND rather than OR).
AND
OR
grep -Plr '(?m)db-connect\.php(.*\n)*version|version(.*\n)*db-connect\.php' .