comm -12 file1.txt file2.txt

Category: Text Processing

comm -12 file1.txt file2.txt

Show only lines common to both sorted files

Shows only the lines that appear in BOTH sorted files — the intersection of the two files.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.