comm

Compare two sorted files line by line

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Shows lines unique to each file and lines common to both.

Common flags
FlagMeaning
-12Show only common lines
-23Show lines only in file 1
Examples
comm -23 <(sort a) <(sort b)Lines in a but not in b · explain & risk-check →
Related
diff sort uniq
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man comm for your version. Test destructive commands on a non-production system first.