From owner-freebsd-questions@FreeBSD.ORG Thu Nov 13 14:55:36 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 0300A16A4CE for ; Thu, 13 Nov 2003 14:55:36 -0800 (PST) Received: from web40611.mail.yahoo.com (web40611.mail.yahoo.com [66.218.78.148]) by mx1.FreeBSD.org (Postfix) with SMTP id 5F01943FDF for ; Thu, 13 Nov 2003 14:55:35 -0800 (PST) (envelope-from patterner@rocketmail.com) Message-ID: <20031113225534.69670.qmail@web40611.mail.yahoo.com> Received: from [208.19.10.119] by web40611.mail.yahoo.com via HTTP; Thu, 13 Nov 2003 14:55:34 PST Date: Thu, 13 Nov 2003 14:55:34 -0800 (PST) From: Chris Readle To: Matthew Hunt , Francisco Reyes In-Reply-To: <20031113224657.GA66502@wopr.caltech.edu> 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 Reply-To: patterner@rocketmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 22:55:36 -0000 --- Matthew Hunt wrote: > On Thu, Nov 13, 2003 at 05:37:39PM -0500, 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 > > > > I get no files. However, if I go into one of the subdirectories and do > a > > plain grep *.c then is found on several files. > > When using "-r", the arguments to grep should be directories. It will > process all of the files in the given directories, recursively. There > is > no provision for searching a subset of the files (i.e. "*.c). If you > need to do that, use find and xargs. > You can also do this with something like: ls -laR | egrep *.c chris __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree