I'd like to compare two files and delete lines in file1 if they contain a pattern found anywhere in file2. I did some searching and the closest answers I've been able to find were how to delete lines that appear in another file.
I'd like a simple grep, awk, sed, etc one-liner if possible. I'm matching on IP addresses, as shown below.
file1
10.10.50.1 00:00:10:23 0000.0012.3456 Vlan1
10.10.50.2 00:00:12:34 1234.56AB.CDEF Vlan2
10.10.50.3 00:00:23:10 ABCD.EF12.345 Vlan3billion
file2
these-are some_words 10.10.50.2 andmaybe some-other words
theseare somewords 10.10.50.99 and-maybe some_other words
Expected output:
10.10.50.1 00:00:10:23 0000.0012.3456 Vlan1
10.10.50.3 00:00:23:10 ABCD.EF12.345 Vlan3billion
e somor.2 andmapossible patterns? Or could you normalizefile2to one token per line? (In which case the rest should be trivial.) - tripleeefile2to just IP addresses, one per line" and you can take it from there? - tripleee