Home OS X
OS X Syntax

comm

Compare two sorted files line by line.

SYNTAX
      comm [-123] file1 file2

Options
     -1      Suppress printing of column 1.

     -2      Suppress printing of column 2.

     -3      Suppress printing of column 3.

Notes
The comm utility reads file1 and file2, which should be sorted lexically, and produces three text columns as output:

 lines only in file1; lines only in file2; lines in both files. 

The filename ``-'' means the standard input.

If printing of a column is suppressed, the output will be padded with TAB characters.

"You don't sew with a fork, so I see no reason to eat with knitting needles" - Miss Piggy, on eating Chinese Food

Related commands:

cmp - Compare two files
diff - Display the differences between two files
diff3 - Show differences among three files
sdiff - merge two files interactively
sort - Sort text files

Equivalent BASH command:

comm
- Compare two sorted files line by line.



Back to the Top

Simon Sheppard
SS64.com