I have what looked to me as a simple operation but cannot find a solution. I need to search through files in a directory with lines containing str1 AND str2. There are several examples of str1|str2 e.g. grep -r “str1|str2” . But nothing for str1 AND str2. Can anyone provide a solution. This should be a common problem.
I have what looked to me as a simple operation but cannot find a
Share
You can do something like:
with
egrep. Or with positive lookahead/behind regexes. Read the manual.