home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    


comm [options ] file1 file2

Compare lines common to the sorted files file1 and file2 . Three-column output is produced: lines unique to file1 , lines unique to file2 , and lines common to both files . comm is similar to diff in that both commands compare two files. In addition, comm can be used like uniq ; that is, comm selects duplicate or unique lines between two sorted files, whereas uniq selects duplicate or unique lines within the same sorted file.



Read the standard input.


Suppress printing of Column 1.


Suppress printing of Column 2.


Suppress printing of Column 3.


Print only lines in Column 3 (lines common to file1 and file2 ).


Print only lines in Column 2 (lines unique to file2 ).


Print only lines in Column 1 (lines unique to file1 ).


Compare two lists of top-10 movies and display items that appear in both lists:

comm -12 shalit_top10 maltin_top10

Previous: Reference: comb UNIX in a Nutshell: System V Edition Next: Reference: compress
Reference: comb Book Index Reference: compress

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System