Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
comm(1) OSS Shell and Utilities Reference Manual
2. To display any one or two of the three output columns, include the appropriate
flags to suppress the columns you do not want. For example, the following
command displays lines that appear only in file1 and only in file2:
comm -3 file1 file2
Anaheim
Atlanta
Baltimore
Boston
Cincinnati
Cleveland
Dallas
Denver
Detroit
Houston
Kansas City
Los Angeles
Miami
Milwaukee
Minneapolis
Montreal
Oakland
Philadelphia
Pittsburgh
San Diego
San Francisco
Seattle
St. Louis
Toronto
3. The following command displays lines that appear only in file2:
comm -13 file1 file2
Atlanta
Cincinnati
Denver
Houston
Los Angeles
Miami
Montreal
Philadelphia
Pittsburgh
San Diego
San Francisco
St. Louis
4. The following command displays only those lines that appear in both file1 and
file2:
comm -12 file1 file2
Chicago
New York
2−96 Hewlett-Packard Company 527188-021