From owner-freebsd-questions@FreeBSD.ORG Thu Nov 13 14:46:58 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 B4EBE16A4CE for ; Thu, 13 Nov 2003 14:46:58 -0800 (PST) Received: from wopr.caltech.edu (wopr.caltech.edu [131.215.103.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CD0943FDF for ; Thu, 13 Nov 2003 14:46:58 -0800 (PST) (envelope-from mph@wopr.caltech.edu) Received: from wopr.caltech.edu (localhost.caltech.edu [127.0.0.1]) by wopr.caltech.edu (8.12.9/8.12.9) with ESMTP id hADMkvpZ066604; Thu, 13 Nov 2003 14:46:57 -0800 (PST) (envelope-from mph@wopr.caltech.edu) Received: (from mph@localhost) by wopr.caltech.edu (8.12.9/8.12.9/Submit) id hADMkvrv066603; Thu, 13 Nov 2003 14:46:57 -0800 (PST) Date: Thu, 13 Nov 2003 14:46:57 -0800 From: Matthew Hunt To: Francisco Reyes Message-ID: <20031113224657.GA66502@wopr.caltech.edu> References: <20031113173505.F84157@zoraida.natserv.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031113173505.F84157@zoraida.natserv.net> User-Agent: Mutt/1.5.1i 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: Thu, 13 Nov 2003 22:46:58 -0000 X-List-Received-Date: Thu, 13 Nov 2003 22:46:58 -0000 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. -- Matthew Hunt * UNIX is a lever for the http://www.pobox.com/~mph/ * intellect. -J.R. Mashey