Selects or rejects lines common to two sorted files.
Note: If you specify - (minus) for one of the file names, the comm command reads standard input.
The comm command reads the File1 and File2 parameters and writes, by default, a three-column output to standard output. The columns consist of:
Both File1 and File2 should be sorted according to the collating sequence specified by the current National Language environment.
| Item | Description | 
|---|---|
| -1 | Suppresses the display of the first column (lines in File1). | 
| -2 | Suppresses the display of the second column (lines in File2). | 
| -3 | Suppresses the display of the third column (lines common to File1 and File2). | 
This command returns the following exit values:
| Item | Description | 
|---|---|
| 0 | All input files were output successfully. | 
| >0 | An error occurred. | 
comm things.to.do things.donethings.to.do
 
buy soap
groceries
luncheon
meeting at 3
system update
tech. review
 
things.done
 
2nd revision
interview
luncheon
system update
tech. review
weekly report       2nd revision
buy soap
groceries
       interview
               luncheon
meeting at 3
               system update
               tech. review
       weekly reportcomm -23 things.to.do things.donebuy soap
groceries
meeting at 3| Item | Description | 
|---|---|
| /usr/bin/comm | Contains the comm command. |