Could ARG_MAX be increased?

John Baldwin jhb at FreeBSD.org
Thu Sep 23 12:44:09 PDT 2004


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


More information about the freebsd-current mailing list