Consider I have two text files.
First File name - "Emails.txt" with the following data:
00alenoush_p@hotmail00iiiiiiii_l@hotmail.com
00alitayfu@hotmail00rrrrrrrr@hotmail.com
00alqur@gmail00zzzzz@gmail.com
00amoinu@gotmail00eeeeee@gotmail.com
00amoinu@uor00gggggg@uor.edu
00anderson@yahoo00uuuuuuuu@yahoo.com
00c21_pk@cmail00e21_ss@cmail.com
00chemitex@cmail00gggggggg@cmail.com
00cindysun48@hotmail00zzzzzzzz48@hotmail.com
00consult_2020@gotmail00aaaaaaa_2020@gotmail.com
brandcat@gmailjjjjjjjj@gmail.com
Second text file - "Banned.txt" with the following strings:
@gotmail.com
@cmail.com
@uor.edu
How to delete all the lines in the 1st text file "Emails.txt" if it matches the stings of any line present in the second text file "Banned.txt"?
The desired output of the new file should be:
00alenoush_p@hotmail00iiiiiiii_l@hotmail.com
00alitayfu@hotmail00rrrrrrrr@hotmail.com
00alqur@gmail00zzzzz@gmail.com
00anderson@yahoo00uuuuuuuu@yahoo.com
00cindysun48@hotmail00zzzzzzzz48@hotmail.com
brandcat@gmailjjjjjjjj@gmail.com
Can this be done using SED or awk in Linux? Can you please suggest how to do this?