Skip to content

Instantly share code, notes, and snippets.

@neontorrent
Last active June 16, 2023 18:41
Show Gist options
  • Save neontorrent/cf96eb49f5e76e6b3698a32a970bbc7b to your computer and use it in GitHub Desktop.
Save neontorrent/cf96eb49f5e76e6b3698a32a970bbc7b to your computer and use it in GitHub Desktop.
Find missing records in A.txt, but not in reference set B.txt
awk 'NR==FNR{a[$0]=1;next}!a[$0]' B A
# or better memory usage:
awk 'NR==FNR{a[$0];next} !($0 in a)' B A
grep -Fvx -f B.txt A.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment