Grep Match entire email multiple lines

Hello I have to files:

I have this fist file


And I want it to match this second file, but the whole email, not just the appearance of the word:

So I want the output to be:


I try with grep -f, but, since the words appear in the email, I get all the lines of the first file, not just the ones that matches with the whole email.


>Solution :

Use the -w argument.

grep -w '' file.txt



Bash script example to compare two files:



grep -w -F -f "$strings_file" "$input_file"

Leave a Reply