Re: Search for two words in a File

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

 



Tim wrote:
On Wed, 2006-04-26 at 10:50 +0100, Paul Howarth wrote:
grep -E 'deep|html' test

Wouldn't that match against *either* word, rather than require both to
be present?

If you want to search for both words in the same line, just pipe the output:

cat thefile | grep html | grep test

First it'll find all the 'html' lines and then within those results, it'll narrow down to the 'test' lines.


Justin Willmert


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

  Powered by Linux