Re: Could ARG_MAX be increased?

From: David O'Brien <obrien_at_FreeBSD.ORG>
Date: Thu, 23 Sep 2004 19:37:20 +0000
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.

-- 
-- David    (obrien_at_FreeBSD.org)
Received on Thu Sep 23 2004 - 17:37:20 UTC

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