From owner-freebsd-questions Thu Dec 27 14:21:53 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cody.jharris.com (cody.jharris.com [205.238.128.83]) by hub.freebsd.org (Postfix) with ESMTP id B732037B417 for ; Thu, 27 Dec 2001 14:21:47 -0800 (PST) Received: from localhost (nick@localhost) by cody.jharris.com (8.11.1/8.9.3) with ESMTP id fBRMLj798462; Thu, 27 Dec 2001 16:21:45 -0600 (CST) (envelope-from nick@rogness.net) Date: Thu, 27 Dec 2001 16:21:45 -0600 (CST) From: Nick Rogness X-Sender: nick@cody.jharris.com To: Drew Tomlinson Cc: questions@FreeBSD.ORG Subject: Re: How To Recursively Search Directory For Text String In Files? In-Reply-To: <011701c18f24$951d3b00$c42a6ba5@lc.ca.gov> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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, 27 Dec 2001, Drew Tomlinson wrote: > OK, I am beginning to understand the power of FBSD and am sure this is > possible. I just don't know how to do it. What I want to do is > search all files in my current directory and all the directories below > it for a text string and then know what file(s) contains the string. > I understand that grep will do the search but my knowledge is limited > to "cat file.txt | grep string". How can I construct a command in > tcsh to feed each file to cat and then feed it to grep *AND* know the > name of the file grep found the match? Do I have the right concept? > Is there a better way to accomplish my goal? man find Nick Rogness - Don't mind me...I'm just sniffing your packets To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message