Grep Guru

Frank Shute frank at shute.org.uk
Sun Jun 8 20:34:27 UTC 2008


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 



More information about the freebsd-questions mailing list