Re: grep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 30 January 2005 12:48, Bill Gradwohl wrote:
 
>
> Does anyone know how to construct a regular expression or in any
> way get a single grep execution to do an AND instead of an OR
> operation so that it looks for more that one string and matches a
> line when ALL the items exist on that line, and are possibly in
> RANDOM order?
>
> i.e. Find these lines
> cat dog bird
> bird dog cat
> dog cat bird
> etc.
>
 

Not a single grep expression but .....

grep "dog" <filename> | grep "cat" | grep "bird"

Regards, Mike Klinke


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux