> On 20010403.1408, Cory Petkovsek said ...
>
> Yup.
> 
> $ zgrep -i linux /usr/doc/HOWTO/en-txt/* | grep Network |grep Security
> /usr/doc/HOWTO/en-txt/Security-HOWTO.txt.gz:  Linux Network Administrator's Guide By 
>Olaf Kirch
> 
> Try just one of the piped commands.  Ie, just the zgrep command.  Then the first two 
>commands, and see the different results.
> 
> > I often grep for words within a dir full of files and then want to
> > grep through the results of the first grep, but don't know if you can
> > grep the result of a grep without outputing it into a temp file.
> 
> Reread what you are asking.  Grep result of a grep [by] outputing to a temp file.  
>Use stdout/stdin as your temp file by using the pipe.
> 
> grok?

Let's see if I do...

$ grep string1 string2 filename(s)

will find those files that contain string1 _OR_ string2

whereas

$ grep string1 filename(s) | grep string2

will find those files that contain string1 _AND_ string2

Correct?

Thanks,
Rob

Reply via email to