Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

comm(1) OSS Shell and Utilities Reference Manual
NAME
comm - Compares two sorted les
SYNOPSIS
comm [-123] le1 le2
The comm command reads le1 and le2 and writes three columns to the standard output
le, showing which lines are common to both les and which are unique to each le.
FLAGS
-1 Suppresses output of the rst column (lines only in le1).
-2 Suppresses output of the second column (lines only in le2).
-3 Suppresses output of the third column (lines common to le1 and le2).
The command comm -123 produces no output.
DESCRIPTION
The leftmost column of the standard output le includes lines that are only in le1. The middle
column includes lines that are only in le2. The rightmost column includes lines that are in both
le1 and le2. Columns are separated by tab characters.
If you specify - (dash) in place of one of the lenames, the comm command reads the standard
input le.
The le1 and le2 arguments should be sorted according to the collating sequence specied by
the LC_COLLATE environment variable (see the reference page for the sort command), or the
comm command fails.
EXAMPLES
In the following examples, le le1 contains the following sorted list of North American cities:
Anaheim
Baltimore
Boston
Chicago
Cleveland
Dallas
Detroit
Kansas City
Milwaukee
Minneapolis
New York
Oakland
Seattle
Toronto
260 Hewlett-Packard Company 527188-004