Last active
January 13, 2021 11:14
-
-
Save H-Max/1324427c0411f8b76946931ed98d9666 to your computer and use it in GitHub Desktop.
One liner to compare 2 files and keep only the difference
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
# Unique lines only (does not work if lines are present more than once in any of the 2 source files) | |
comm -13 <(head -n 1 a.txt && tail -n +2 a.txt | sort) <(head -n 1 b.txt && tail -n +2 b.txt | sort) > compare.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment