[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: find in conjuction with grep
- From: "David Gavin" <dgavin davegavin 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:53:20 -0400 (EDT)
Kevin,
If you're looking for the names of files that contain your search
argument, try the -l option of grep:
find . -exec grep -l "phrase I want" {} \;
This will not show the line containing the search text, just the name of
the file(s) that contains it.
Dave
Kevin Old said:
> Hello everyone,
>
> I've been using
> find . -exec grep "phrase I want" {} \;
> 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.
>
> 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.
>
> Any help is appreciated.
>
> Kevin
> --
> Kevin Old
> kevinold gmail com
>
>
> --
> fedora-list mailing list
> fedora-list redhat com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]