Untitled Document
comm Command

comm command compares two sorted files line by line .With no options, comm produces 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. Each of these columns can be suppressed individually with options. For examples we have creates 2 csv files emp.csv and emp1.csv

1. Basic example -

Run te comm command without any options .

   comm emp.csv emp1.csv

2. With options -12

The above option prints only lines present in both files emp.csv and emp1.csv

   comm -12 emp.csv emp1.csv

3.With options -3

Print only the lines that are present in emp.csv and not emp1.csv, and vice versa.

 comm -3 emp.csv emp1.csv
Untitled Document