0% found this document useful (0 votes)
21 views

Synopsis: Options File1 File2

The comm command compares two sorted files line by line and outputs three columns showing lines unique to each file or common to both files. It can suppress certain columns and compares files passed either via stdin, stdout, or as command line arguments.

Uploaded by

Salvatore Cozza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Synopsis: Options File1 File2

The comm command compares two sorted files line by line and outputs three columns showing lines unique to each file or common to both files. It can suppress certain columns and compares files passed either via stdin, stdout, or as command line arguments.

Uploaded by

Salvatore Cozza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

comm [options] file1 file2 — coreutils

Synopsis

/usr/bin stdin stdout - file -- opt --help --version

The comm command compares two sorted files and produces three columns of output,
separated by tabs:

1. All lines that appear in file1 but not in file2.


2. All lines that appear in file2 but not in file1.
3. All lines that appear in both files.

For example, if file1 and file2 contain these lines:

file1: file2:
apple baker
baker charlie
charlie dark

then comm produces this output:

$ comm file1 file2

apple

baker

charlie

dark

Useful options

-1 Suppress column 1.
-2 Suppress column 2.

-3 Suppress column 3.

With Safari, you learn the way you learn best. Get unlimited
access to videos, live online training, learning paths, books,
interactive tutorials, and more.

You might also like