From owner-freebsd-questions Wed Feb 20 3:28:36 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 416E037B402 for ; Wed, 20 Feb 2002 03:28:33 -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 05222CD2BC for ; Wed, 20 Feb 2002 12:28:30 +0100 (CET) Date: Wed, 20 Feb 2002 12:28:21 +0100 From: F.Xavier Noria To: freebsd-questions@FreeBSD.org Subject: Re: how to search IN a bunch of files? Message-Id: <20020220122821.713524ea.fxn@isoco.com> In-Reply-To: <20020220121803.E5644@xs4all.nl> References: <20020220121803.E5644@xs4all.nl> X-Mailer: Sylpheed version 0.7.1 (GTK+ 1.2.10; i386--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 Wed, 20 Feb 2002 12:18:04 +0100 rene@xs4all.nl wrote: : Hello. I'd like to be able to search in all files on my freebsd system for a : given regexp. Yes, I want to search the contents of the files specified. : : I can get find(1) to supply me with a list of valid paths, but am unsure : how to grep within all these files. an example would be appreciated. If all files need to be considered: $ cd root_dir $ grep -r pattern . If you need to filter out some of them: $ cd root_dir $ find . -name '*.foo' -print | xargs grep pattern -- fxn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message