Date: Tue, 23 Dec 1997 15:09:55 +0000 From: Brian Somers <brian@awfulhak.org> To: joelh@gnu.org Cc: freebsd-questions@freebsd.org Subject: Re: using the find command Message-ID: <199712231509.PAA10788@awfulhak.demon.co.uk> In-Reply-To: Your message of "Sun, 21 Dec 1997 23:07:51 CST." <199712220507.XAA05231@detlev.UUCP>
next in thread | previous in thread | raw e-mail | index | archive | help
> (Apologies to threaders)
>
> >> 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 {} \;
>
> This is less efficient than
> grep string `find . -print`
Hmm, this isn't very good at all if you've got a large number of
files under `.'. The best way(s) to do it is either
find . | xargs grep string
or as someone else pointed out,
grep -R string .
>
> Also note that '-name *' is redundant in find.
>
> Cheers,
> joelh
>
> --
> Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan
> Fourth law of programming:
> Anything that can go wrong wi
> sendmail: segmentation violation - core dumped
--
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
<http://www.Awfulhak.org>
Don't _EVER_ lose your sense of humour....
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712231509.PAA10788>
