Fri 26 Aug 2005
To search for all files that contain a certain string use find with the -exec flag. For example:
find . -name "*.haystack" -type f -exec grep -l needle "{}" ";"
grep -l flag tells grep to output only the file name if there is a match.
"{}" is replaced iteratively by the file names found.
";" terminates the command.
September 15th, 2005 at 4:50 am
On Bash shells I use a variant of your command:
find . -exec grep -l -s -i ’string’ {}\;