Re: [SLE] grep help
Samy Elashmawy
I tried grep -r "arch4" /
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/
At 07:43 PM 5/15/2000 -0400, François Pinard wrote:
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/
How about trying: grep arch4 * grep arch4 /* grep arch4 /*/* etc. etc. I'm just learning about grep but this seems to work for me. Thanks! jrh -----Original Message----- From: Samy Elashmawy [mailto:samelash@ix.netcom.com] Sent: Tuesday, May 16, 2000 4:03 AM To: François Pinard Cc: suse-linux-e@suse.com Subject: Re: [SLE] grep help At 07:43 PM 5/15/2000 -0400, François Pinard wrote:
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/
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/
participants (4)
-
jhoepner@tvsw.org
-
keith@HaggleWare.com
-
pinard@iro.umontreal.ca
-
samelash@ix.netcom.com