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 ...

Get Linux® Desk Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.