From owner-freebsd-current@FreeBSD.ORG Thu Sep 23 22:00:55 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 71A2D16A4CE; Thu, 23 Sep 2004 22:00:55 +0000 (GMT) Received: from saturn.criticalmagic.com (saturn.criticalmagic.com [64.74.124.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CEEF43D48; Thu, 23 Sep 2004 22:00:55 +0000 (GMT) (envelope-from rcoleman@criticalmagic.com) Received: from [10.40.30.108] (borg.ciphertrust.com [64.238.118.66]) by saturn.criticalmagic.com (Postfix) with ESMTP id 6A9BF3BD21; Thu, 23 Sep 2004 18:00:54 -0400 (EDT) Message-ID: <41534790.1000702@criticalmagic.com> Date: Thu, 23 Sep 2004 18:00:48 -0400 From: Richard Coleman Organization: Critical Magic, Inc. User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Baldwin References: <20040923193720.GB10928@hub.freebsd.org> <200409231544.32001.jhb@FreeBSD.org> In-Reply-To: <200409231544.32001.jhb@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Cyrille Lefevre cc: Juha Saarinen cc: freebsd-current@FreeBSD.org cc: David O'Brien Subject: Re: Could ARG_MAX be increased? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2004 22:00:55 -0000 John Baldwin 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. :) > I've been using the following for many moons. It works on just about any unix box and is almost as fast. I guess I got into the habit of using it since the grep on older boxes don't support any recursion. find . -type f -print | xargs egrep -i REGEXP /dev/null Richard Coleman rcoleman@criticalmagic.com