I have multiple files in multiple directories, and I need a grep command which can return the output only when both the patterns are present in the file. The patterns are like
Registrationrequest. The patterns are not in the same line.
AccessToken can be in one line and
Registrationrequest can be in another line. Also search the same recursively across all files in all directories.
grep -r "string1” /directory/file | grep "string 2” grep -rl 'string 1' | xargs grep 'string2' -l /directory/ file grep -e string1 -e string2
Can anyone please help?