13 September 2021

How to grep word1 & word2?

https://stackoverflow.com/questions/4487328/match-two-strings-in-one-line-with-grep

You can use

grep -inH 'string1' filename | grep -inH 'string2'

Or

grep -inH 'string1.*string2\|string2.*string1' filename

 

No comments:

Post a Comment