Date: Sun, 21 Dec 1997 19:44:06 -0800 From: Studded <Studded@dal.net> To: John-David Childs <jdc@nterprise.net>, mike@chaski.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: using the find command Message-ID: <349DE206.9512157A@dal.net> References: <199712211441.OAA13857@chaski.com> <19971221141158.00667@denver.net>
next in thread | previous in thread | raw e-mail | index | archive | help
John-David Childs wrote: > > On Sunday December 21, 1997, michael dorin <mike@chaski.com> > 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. Errrr... yes it will. :) 'grep -i string *' will do all the files in the same directory, and 'grep -iR string *' will recurse the tree. The -i option means do a case insensitive search. You can man grep for more info. Hope this helps, Doug
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?349DE206.9512157A>