Hi,

I know that I can use this to grep two patterns. But it can not
highlight both patterns.

grep word1 FILE | grep word2

Or I can use the following. But it is cumbersome as I have to type
word1 and word2 twice. And this method is not scale if I want grep
multiple patterns. The coloring can not be just for word1 and word2
only.

grep -E 'word1.*word2|word2.*word1' logs

Could anybody let me know what is the best way to grep two patterns in
a line with correct coloring? Thanks.

-- 
Regards,
Peng



Reply via email to