Date: Sun, 8 Jun 2008 21:34:20 +0100 From: Frank Shute <frank@shute.org.uk> To: Simon Jolle sjolle <urandomdev@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Grep Guru Message-ID: <20080608203420.GA92357@melon.esperance-linux.co.uk> In-Reply-To: <484C3FB7.4080208@gmail.com> References: <484C3CC4.7050107@webrz.net> <20080608201256.GA28987@ayn.mi.celestial.com> <484C3FB7.4080208@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 08, 2008 at 10:23:19PM +0200, Simon Jolle sjolle wrote: > > On 06/08/2008 10:12 PM, Bill Campbell wrote: > > On Sun, Jun 08, 2008, Jos Chrispijn wrote: > >> I tried to make a grep script on find a string in all files on path ./ > >> and down. It does anything exept searching in files and reporting them. > >> Is there a Grep Guru who can hint me out? Thanks, > > > > I expect you need something like: > > > > find . -type f -print0 | xargs -0 grep pattern > > Or install the GNU grep (from the man) > > -R, -r, --recursive > Read all files under each directory, recursively; this is > equivalent to the -d recurse option. > What's gained from GNU grep? FreeBSD grep, automatically recurses in to each subdir unless given the -maxdepth option. Looks like FreeBSD grep wins (one less argument needed) ;) > > Bill > > cheers > Simon > > Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080608203420.GA92357>