grep

Hello,
how to make "grep" instruction go down to subdirectories ? Thank you.
PS : I want to find a file containing a "word" everywhere ( any subdirectory ) it is.
Thanks before.

Why not couple find and grep.. like this

find . -exec grep 'searchstring' {} \; -print'

Vino

in aix that would find the text in whatever file, but that wouldn't show you which file it was in. i have to do this:

for i in $(find . -type f); do grep 'searchstring' $i; done

be on the lookout for binaries and data files with grep...SO:

for i in $(find . -type f); do [[ -f $i ]] && grep 'searchstring' $i; done

etc.

There is anoter option, you can fool grep into displaying the filename of the file by supplying a second file in which to search, however since you want to be sure of having no matches in that file you use /dev/null.

find . -type f -exec grep -l 'searchstring' {} /dev/null \; 

Many thanks to all.