[plug] Search contents of a file
Peter Wright
pete at cygnus.uwa.edu.au
Fri May 26 18:45:38 WST 2000
On Fri, May 26, 2000 at 06:33:02PM +0800, Peter Wright wrote:
> Surely (when in /etc)
>
> $ grep -l mail.wa *
>
> should work?
Or just plain
$ grep mail.wa *
if you want to see the matched lines in the files too.
The reason your "cat * | grep" couldn't give you the filenames is
because in that case as far as grep's concerned it'd just be receiving
a lot of stuff piped in from standard input, and wouldn't know any
more about it.
You might as well be saying
$ echo "Hello there" | grep Hello
:)
Pete.
--
http://cygnus.uwa.edu.au/~pete/
--
"While not obviously a business-friendly license there are certain aspects of
the GNU license which are attractive, believe it or not, for commercial
purposes."
-- Brian Behlendorf on OSS (Open Sources, 1999 O'Reilly and Associates)
More information about the plug
mailing list