From owner-freebsd-questions Thu Mar 7 6:23:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from smtp.bcn.isoco.net (ldap.isoco.net [212.9.90.11]) by hub.freebsd.org (Postfix) with ESMTP id C4AC037B402 for ; Thu, 7 Mar 2002 06:23:14 -0800 (PST) Received: from fxn.bcn.isoco.net (fxn.bcn.isoco.net [172.16.1.50]) by smtp.bcn.isoco.net (Postfix) with SMTP id 4D499CD2BA; Thu, 7 Mar 2002 15:23:13 +0100 (CET) Date: Thu, 7 Mar 2002 15:23:09 +0100 From: F.Xavier Noria To: mpd Cc: freebsd-questions@FreeBSD.org Subject: Re: grep.... recursive searching Message-Id: <20020307152309.1dbb57cb.fxn@isoco.com> In-Reply-To: <20020307091002.A45751@rochester.rr.com> References: <20020307101335.6460.qmail@web20102.mail.yahoo.com> <20020307091002.A45751@rochester.rr.com> X-Mailer: Sylpheed version 0.7.3 (GTK+ 1.2.10; i386-portbld-freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 7 Mar 2002 09:10:03 -0500 mpd wrote: : On Thu, Mar 07, 2002 at 02:13:35AM -0800, Bsd Neophyte wrote: : > : > I'm reading up on grep... (thanks for the explaining the find command... : > that let me move forward)... and i've noticed that while you can search : > for a "regular expression" (did I use that right?) there is no mention of : > any ability to do a recursive search. : > : > i checked the man page and seached for the "regular expression" (this will : > be on a quiz tomorrow... that's why i'm using it so much :D ) "recursive" : > but nothing came up. : > : > is there some uncomplicated way of doing a recursive search with grep? : > : > -Sameer : > : : I'm more curious of a way to make it recurse through all the : directories, but only try to match on certain files. : Is this even possible with this version of grep? The fm (of : rtfm fame) isn't giving me any epiphanies. The standard idiom for this is to filter the files you are interested in with `find' and then pass the filenames to `grep'. For instace, $ find . -name '*.lisp' | xargs grep TODO would find occurrences of the string "TODO" in all lisp source files below .. As was mentioned some hours ago in another thread, `find' comes with a set of boolean operators to filter its output. They are documented in its man page. -- fxn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message