From owner-freebsd-questions@FreeBSD.ORG Thu Nov 13 18:32:44 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B17A16A4CE for ; Thu, 13 Nov 2003 18:32:44 -0800 (PST) Received: from priv-edtnes56.telusplanet.net (defout.telus.net [199.185.220.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04AB643FDD for ; Thu, 13 Nov 2003 18:32:43 -0800 (PST) (envelope-from viktorlazlo@telus.net) Received: from [192.168.1.101] (really [66.183.123.52]) by priv-edtnes56.telusplanet.netESMTP <20031114023242.HYQA16280.priv-edtnes56.telusplanet.net@[192.168.1.101]>; Thu, 13 Nov 2003 19:32:42 -0700 Date: Thu, 13 Nov 2003 18:32:48 -0800 (PST) From: Viktor Lazlo X-X-Sender: viktorlazlo@d66-183-123-52.bchsia.telus.net To: Dan Busarow In-Reply-To: Message-ID: <20031113183118.T3617@d66-183-123-52.bchsia.telus.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: FreeBSD Questions List Subject: Re: Recursion with grep? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2003 02:32:44 -0000 On Thu, 13 Nov 2003, Dan Busarow wrote: > On Nov 13, Francisco Reyes wrote: > > The man page for grep says to use "-r" to recurse, yet when I try > > something like > > > > grep -r -li string *.c > > find . -name "*.c" -exec grep -li string {} \; If there are a large number of files this will call grep numerous times--it would be more efficient to pass to xargs so grep is only called a few times: find . -type f -print | xargs grep options string Cheers, Viktor