I have a file that has 2 columns like the following:
apple pear
banana pizza
spoon fork
pizza plate
sausage egg
If a word appears on multiple lines i want to delete all lines that the repeating word appears, as you can see 'pizza' appears twice so 2 lines should be deleted, the following is the required output:
apple pear
spoon fork
sausage egg
I am aware of using :
awk '!seen[$1]++'
However this only removes the lines when the string appears in one column, i require a command that will check both columns. How can i achieve this?