Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2009 17:14:49 +0100
From:      RW <rwmaillists@googlemail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: find and searching for specific expression in files
Message-ID:  <20090530171449.3719f9d6@gumby.homeunix.com>
In-Reply-To: <200905301412.50958.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>
References:  <dd6b168d2af9ddbcfc52e5c0397e4d6a.squirrel@relay.lc-words.com> <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com> <139b44430905300456x62bf9c0ybf46bcab6b64e25@mail.gmail.com> <200905301412.50958.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 30 May 2009 14:12:50 +0200
Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net> wrote:

> On Saturday 30 May 2009 13:56:22 Valentin Bud wrote:
> > 2009/5/30 Zbigniew Szalbot <z.szalbot@lcwords.com>

> >  You can use egrep -r * (grep -e) to search for specific text
> > pattern while you are in a directory with many sub directories. The
> > output is nice because it tells you the file in which the text
> > pattern was found :).
> 
> Discouraged because:
> - it's possible to hit maxarglen if the root directory has many 
> subdirectories.
> - Will not search hidden directories in the root directory because of
> the shell glob

You can replace "egrep -r <string> *" with "egrep -r <string> ."
i.e. recurse from the current directory, rather than search or recurse
on everything that matches *. That avoids the first two problems, and
most of the time the third doesn't matter

> - cannot be combined with other search criteria such as the file's
> timestamp.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090530171449.3719f9d6>