How do I get grep to search for all files under / that contian the string
"archA"
I treid grep -r "arch4" /
but it did not work. What am I missing ?
find lines contain <pattern> under and print the lines
and filenames.
find -type f -print0 | xargs -r0 grep <pattern> /dev/null
however, this command also looks for binary files and when it is the case,
you may get collapsed result. in order to prevent that, use perl. then
the command would be:
find -type f -print0 | perl -0lne 'print if -T $_' \
| xargs -r0 grep <pattern> /dev/null
this is a bit too long to type so you may want to make this a script.
this worked pretty well; an excellent solution (not my idea).
HTH
--
Have you noticed that all you need to grow healthy, vigorous grass is a
crack in your sidewalk?
--
fortune forever!
`Haj*)
hajimmie@cncn.com
--
To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com
For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/