O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

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

Start Free Trial

No credit card required

Commands

comm

[OPTION]… FILE1 FILE2

This command compares two files and prints the results in three-column output–for example,

unique to file       1unique to file2        common lines

The files must be sorted before comm can be used.

Example: To compare the entries in two database files, t1old.db and t1new.db, use

comm t1old.db t1new.db

cmp

OPTIONS… FROM-FILE [TO-FILE]

-1 Suppress printing of column 1.
-2 Suppress printing of column 2.
-3 Suppress printing of column 3.

cmp compares two files and outputs the first byte and line number where they differ.

Use cmp, rather than diff, to compare binary files.

Example: To compare file1.txt and file2.txt, skipping ...

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

Start Free Trial

No credit card required