From owner-freebsd-questions Thu Dec 27 16:32:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from relay3-gui.server.ntli.net (relay3-gui.server.ntli.net [194.168.4.200]) by hub.freebsd.org (Postfix) with ESMTP id 1ACD737B423 for ; Thu, 27 Dec 2001 16:32:28 -0800 (PST) Received: from pc3-card4-0-cust122.cdf.cable.ntl.com ([62.254.251.122] helo=rhadamanth.private.submonkey.net ident=exim) by relay3-gui.server.ntli.net with esmtp (Exim 3.03 #2) id 16Jkwd-0006KA-00; Fri, 28 Dec 2001 00:32:19 +0000 Received: from setantae by rhadamanth.private.submonkey.net with local (Exim 3.33 #1) id 16JkqB-000LbJ-00; Fri, 28 Dec 2001 00:25:39 +0000 Date: Fri, 28 Dec 2001 00:25:39 +0000 From: Ceri To: Drew Tomlinson Cc: questions@freebsd.org Subject: Re: How To Recursively Search Directory For Text String In Files? Message-ID: <20011228002539.GA82923@rhadamanth> References: <011701c18f24$951d3b00$c42a6ba5@lc.ca.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <011701c18f24$951d3b00$c42a6ba5@lc.ca.gov> User-Agent: Mutt/1.3.24i 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, Dec 27, 2001 at 02:19:42PM -0800, 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". grep -r string * Ceri -- keep a mild groove on To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message