If you're wanting to grep through multiple files in multiple directories some levels deep, use a combination of find, grep, and xargs. For example, my boss wanted to look for a string FOO in all of our sorce code (.c, .cpp, and .h files). This is accomplished like this (assuming we're looking in the current dir and below): keith@develop[pts/7]:~$ find . -type f \( -name \*.c -o \
-name \*.cpp -o -name \*.h \) \ -print0 | xargs --null grep FOO
Check the man for find(1), grep(1), and xargs(1)
Ciao,
kw
/* Keith Warno
** Developer & Sys Admin
** http://www.HaggleWare.com/
*/
----- Original Message -----
From: "Samy Elashmawy"
Samy Elashmawy
writes: I tried grep -r "arch4" /
it only searches the root and nothing below that. I tried grep "arch4" /* /*/* /*/*/* /*/*/*/* ant it stopped with an error arguments two long or something. I was hoping to find the deffinition files that have the size and pixel lenth of the printer page layoust so I could change them to a custom setting. Murphys law ya know
It works here, running version 2.3. But you need a recent version of `grep', I do not remember when the `-r' was added to it. Check with `grep --help' to see if `-r' is supported.
-- François Pinard http://www.iro.umontreal.ca/~pinard
-- 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/
-- 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/ -- 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/