comm(1)
Name
comm − compare sorted data
Syntax
comm [−[123]] file1 file2
Description
The comm command reads file1 and file2, which should be ordered in ASCII collating sequence, and produces a three column output: lines only in file1; lines only in file2; and lines in both files. The file name ‘−’ means the standard input.
Options
1Suppresses column one: lines in file1 only.
2Suppresses column two: lines in file2 only.
3Suppresses column three: lines in file1 and file2.
Thus comm −12 prints only the lines common to the two files. And comm −23 prints only lines in the first file but not in the second. Finally, comm −123 is not an option.