[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: find in conjuction with grep
- From: Kevin Old <kevinold gmail com>
- To: For users of Fedora Core releases <fedora-list redhat com>
- Subject: Re: find in conjuction with grep
- Date: Wed, 11 Aug 2004 14:49:30 -0400
On Wed, 11 Aug 2004 20:43:10 +0200, Alexander Dalloz
<alexander dalloz uni-bielefeld de> wrote:
> Am Mi, den 11.08.2004 schrieb Kevin Old um 20:31:
>
> > I've been using
> > find . -exec grep "phrase I want" {} \;
>
> Not the best way. Using -exec is problematic.
>
> > for quite a while to search recursively through directories and files
> > to find a phrase or word.
> >
> > The results I get back are simply the line(s) that contained the
> > phrase, but no path or filename.
>
> find . -print0 | xargs -0 grep "string"
>
> > I'd thought about the -name flag, but I can't seem to figure out how
> > to use it, though it is more for using to search for file names rather
> > than display the name, it seems.
>
> find /path/to/search/under -name "*string*"
>
> will find all object names with "string" anywhere in, like "stringfoo"
> or "foostringbar" or just "string".
>
I was unclear. I'd like to recursively search directories in order to
find "phrase I want" inside files, not as the file name.
Thanks,
Kevin
--
Kevin Old
kevinold gmail com
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]