One of my favorite moreutils tools is combine[1]. It allows you to compare the contents of text files with boolean operations. For example, want to know what lines are in file1 but not file2? Use:
combine file1 not file2
1. http://manpages.ubuntu.com/manpages/zesty/en/man1/combine.1....