cmp compares two files. By default, if they are different,
it displays the byte and line number at which the first difference
occurred. If
file1 or file2 is ``-'', standard input
is used.
The options are:
-l
Prints the byte number (decimal) and the
differing bytes (octal) for each difference.
-s
Returns an exit code only, 0 for identical files, 1 for different
files, and 2 for inaccessible or missing files.
cmp understands the -- option delimiter.
This command is most useful for comparing binary files. Use
diff(C)
or
diff3(C)
to compare the textual content of text files.
Exit values
cmp returns the following values:
0
the files are identical
1
the files are different: this includes the case where one file is
identical to the first part of the other