From owner-freebsd-questions Sun Dec 21 13:11:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id NAA27404 for questions-outgoing; Sun, 21 Dec 1997 13:11:38 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from milehigh.denver.net (milehigh.denver.net [204.144.180.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id NAA27383 for ; Sun, 21 Dec 1997 13:11:30 -0800 (PST) (envelope-from jdc@milehigh.denver.net) Received: (from jdc@localhost) by milehigh.denver.net (8.8.8/8.8.8) id OAA23558; Sun, 21 Dec 1997 14:11:58 -0700 (MST) Message-ID: <19971221141158.00667@denver.net> Date: Sun, 21 Dec 1997 14:11:58 -0700 From: John-David Childs To: freebsd-questions@freebsd.org Subject: Re: using the find command References: <199712211441.OAA13857@chaski.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.79 In-Reply-To: <199712211441.OAA13857@chaski.com>; from michael dorin on Sun, Dec 21, 1997 at 02:41:54PM +0000 Organization: Enterprise Internet Solutions Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sunday December 21, 1997, michael dorin had this to say about "using the find command": > Can somebody give me the syntax for using the find command to search > all the files in a tree for a specific string? > find . -name "*" -exec grep -l string {} \; will give you the names of the files in the current tree which contain the string you're looking for. If you search for the string directly (i.e. ....grep -ni string....) then it won't tell you in which file(s) it found the string. Someone else may have a better idea how to do this. It seems trivial to write a shell script to first get the names of the files containing and then grep each file in turn. -- > Any help will be apreciated. > > Thanks, > Mike -- John-David Childs (JC612) Enterprise Internet Solutions System Administrator @denver.net/Internet-Coach/@ronan.net & Network Engineer 1031 S. Parker Rd. #I-8 Denver, CO 80231 As of this^H^H^H^H next week, passwords will be entered in Morse code.