comm

The command that compares two sorted files and prints lines unique to the first, unique to the second and common to both, in three columns.

In more detail

Options -1, -2 and -3 hide those columns, so comm -13 shows only lines that appear in the second file alone. Both inputs must be sorted the same way first.

Example

comm -13 expected.txt <(sort -u actual.txt)

Related terms

Taught in

References