Set intersection and difference at the command line
The comm utility performs set operations like intersection and difference on sorted lists at the command line, though its syntax can be hard to remember. It requires input files to be sorted for proper operation.