comm

compare sorted files and show differences 

Command


SYNOPSIS

comm [-123] file1 file2


DESCRIPTION

comm locates identical lines within files sorted in the same collating sequence and produces three columns; the first contains lines found only in the first file, the second lines only in the second file and the third lines which are in both files.

Options

-1 

suppresses lines that appear only in file1.

-2 

suppresses lines that appear only in file2.

-3 

suppresses lines that appear both in file1 and file2.

The options suppress individual columns; thus to list only the lines common to both files, use comm -12

To find lines which are unique to one file or the other use comm -3. Note that comm -123 displays nothing.


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

Failure because of an error opening or reading an input file.

2 

Failure which generated a usage message, such as naming only one input file.

Incorrect command line options are reported but do not affect the exit status value.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista.


AVAILABILITY

MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
cmp, diff, sort, uniq


MKS Toolkit 9.2 Documentation Build 16.