[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22656: How to grep two patterns in a line with correct coloring?
From: |
Peng Yu |
Subject: |
bug#22656: How to grep two patterns in a line with correct coloring? |
Date: |
Sat, 13 Feb 2016 18:10:01 -0600 |
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
- bug#22656: How to grep two patterns in a line with correct coloring?,
Peng Yu <=