Date: Wed, 20 Feb 2002 14:50:08 -0600 From: "Mike Meyer" <mwm-dated-1014670209.5327fb@mired.org> To: F.Xavier Noria <fxn@isoco.com> Cc: questions@freebsd.org, rene@xs4all.nl Subject: Re: how to search IN a bunch of files? Message-ID: <15476.3072.832733.781406@guru.mired.org> In-Reply-To: <69372926@toto.iv>
next in thread | previous in thread | raw e-mail | index | archive | help
F.Xavier Noria <fxn@isoco.com> types: > On Wed, 20 Feb 2002 12:18:04 +0100 > rene@xs4all.nl wrote: > If all files need to be considered: > > $ cd root_dir > $ grep -r pattern . > > If you need to filter out some of them: > > $ cd root_dir > $ find . -name '*.foo' -print | xargs grep pattern Might I suggest a minor tweak to this? Use "xargs grep -H pattern", so that in the unlikely case that you only have one file, you still get the file name printed. <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15476.3072.832733.781406>