Sample Header Ad - 728x90

How to do anti-join or inverse join in bash

2 votes
3 answers
1695 views
I want to perform what some data analysis software call an anti-join: remove from one list those lines matching lines in another list. Here is some toy data and the expected output:
$ echo -e "a\nb\nc\nd" > list1
$ echo -e "c\nd\ne\nf" > list2
$ antijoincommand list1 list2
a
b
Asked by Josh (313 rep)
May 24, 2020, 01:28 PM
Last activity: Jul 12, 2023, 11:06 PM