Last active
August 29, 2015 14:19
-
-
Save lrhache/56e621ce4cb8e585ed58 to your computer and use it in GitHub Desktop.
Find all the missing lines from file B that are in file A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -F -x -v -f <file to compare:file B>.txt <base file:file A>.txt | |
# or: | |
comm <(sort fileB) <(sort fileA) -3 > output.txt | |
# prints lines that are both in file1 and file2 (intersection) | |
awk 'NR==FNR{a[$0];next} $0 in a' file1 file2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment