maux
Star on GitHub Buy me a coffee

Manual / comm

comm(1)

COMM(1) General Commands Manual COMM(1)

comm - print lines common to two files

comm [-123] file1 file2

Comm reads file1 and file2, which should be in sort, and produces a three-column output: lines only in file1; lines only in file2; and lines in both files.

Flags 1, 2, or 3 suppress printing of the corresponding column. Thus comm -12 prints only the lines common to the two files; comm -23 prints only lines in the first file but not in the second; comm -123 prints nothing. Remaining columns are separated by tabs.

/usr/man/COMM this page

sort(1), cmp(1), diff(1), licenses(1)

Exit status is 0 on success, 2 for input-open or usage errors.

Both operands must be file names; '-' is not a standard-input alias. Sorted order is assumed, not checked. Lines longer than 255 bytes are treated as several logical lines.

September 19, 2026 maux