[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: find in conjuction with grep
- From: Aaron Gaudio <prothonotar tarnation dyndns org>
- To: For users of Fedora Core releases <fedora-list redhat com>
- Subject: Re: find in conjuction with grep
- Date: Wed, 11 Aug 2004 16:06:10 -0400
On Wed, 2004-08-11 at 12:45 -0700, Kevin Wang wrote:
> to be a little more explicit and to throw an extra trick in your bag,
> I usually write tihs up (in scripts, not typically on the command
> line) as:
>
> find . -type f -print0 | xargs -0 egrep 'want | phrase' /dev/null
>
> why the /dev/null? grep will only prepend the filename in the output
> if there's more than 1 file. This guarantees that you'll always have
> at least 2 files.
Or, you could use egrep -H :)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]