I want to look for lines with "word1 ... word2" where '...' could be any different characters. So far I have used two greps for the same like this:
grep "$word1" $filename | grep "$word2"
Is there a faster way to do this by suppose something like this:
grep "$word1*$word2" $filename
where maybe * could be some special character which can be any other character(s)?
.*
matches any chararacter repeated 0 or more times (IOW, it matches any string, including the empty string). – NickD Jun 21 '18 at 11:50