comm Command

comm Command

Purpose: Selects or rejects lines common to two sorted files.

Syntax

comm [ -1 -2 -3 ] File1 File2

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:

Lines that are only in File1

Lines that are only in File2

Lines that are in both File1 and File2.

Both File1 and File2 should be sorted according to the collating sequence specified by the current National Language environment.

Flags

-1 Suppresses the display of the first column (lines in File1).

-2 Suppresses the display of the second column (lines in File2).

-3 Suppresses the display of the third column (lines common to File1 and File2).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s