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.
This command returns the following exit values:
0 | All input files were output successfully. |
>0 | An error occurred. |
comm things.to.do things.done
If the files things.to.do and things.done contain the following lists:
things.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
then the comm command displays:
2nd revision buy soap groceries interview luncheon meeting at 3 system update tech. review weekly report
The first column contains the lines found only in things.to.do. The second column, indented with a tab character, lists the lines found only in things.done. The third column, indented with two tabs, lists the lines common to both.
comm -23 things.to.do things.done
This suppresses the second and third columns of the comm command listing. If the files are the same as in Example 1, then the following is displayed:
buy soap groceries meeting at 3
/usr/bin/comm | Contains the comm command. |
The cmp command, diff command, sdiff command, sort command, uniq command.
The environment file.
Understanding Locale in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.
National Language Support Overview for Programming in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.