Re: Could ARG_MAX be increased?

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 23 Sep 2004 15:44:31 -0400
On Thursday 23 September 2004 03:37 pm, David O'Brien wrote:
> On Fri, Sep 24, 2004 at 07:33:27AM +1200, Juha Saarinen wrote:
> > On Thu, 23 Sep 2004 15:46:26 +0200, Cyrille Lefevre
> >
> > <root_at_gits.dyndns.org> wrote:
> > > how about grep -r ou find | xargs grep !
> >
> > How does that work, out of curiosity?
> >
> > You can use the -exec feature of 'find' other wise -
> >
> > find . -type f -exec grep "something" {} /dev/null \;
>
> Using the '-exec' feature of 'find' fork+exec for *every* file found.
> Using xargs reduces the number of fork+exec by the number of filenames
> that fit on the command line.  So it runs much quicker.

'grep -r .' even quicker. :)

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Thu Sep 23 2004 - 17:44:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:13 UTC