Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
comm(1) OSS Shell and Utilities Reference Manual
File file2 contains this sorted list:
Atlanta
Chicago
Cincinnati
Denver
Houston
Los Angeles
Miami
Montreal
New York
Philadelphia
Pittsburgh
San Diego
San Francisco
St. Louis
1. To display the lines unique to each file and common to the two files, enter:
comm file1 file2
This command results in the following output:
Anaheim
Atlanta
Baltimore
Boston
Chicago
Cincinnati
Cleveland
Dallas
Denver
Detroit
Houston
Kansas City
Los Angeles
Miami
Milwaukee
Minneapolis
Montreal
New York
Oakland
Philadelphia
Pittsburgh
San Diego
San Francisco
Seattle
St. Louis
Toronto
The leftmost column contains lines only in file1, the middle column contains lines only
in file2, and the rightmost column contains lines common to both files.
2−64 Hewlett-Packard Company 527188-007