Extracting unique values between 2 sets/files

Working in linux/shell env, how can I accomplish the following:

text file 1 contains:

1
2
3
4
5

text file 2 contains:

6
7
1
2
3
4

Answer:-
# awk 'FNR==NR {a[$0]++; next} !a[$0]' file1 file2
6
7

Leave a Reply