COMM(1) General Commands Manual COMM(1)

comm - Compare two sorted files line by line.

When FILE1 or FILE2 (not both) is -, read standard input.

With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.

comm [OPTION]... FILE1 FILE2

Compare two sorted files line by line.

When FILE1 or FILE2 (not both) is -, read standard input.

With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.

-1
suppress column 1 (lines unique to FILE1)
-2
suppress column 2 (lines unique to FILE2)
-3
suppress column 3 (lines that appear in both files)
separate columns with STR
line delimiter is NUL, not newline
output a summary
check that the input is correctly sorted, even if all input lines are pairable
do not check that the input is correctly sorted
Print help
Print version
<FILE1>
<FILE2>

v(uutils coreutils) 0.11.0

2026-09-01