The cmp utility compares two files of any type and writes the results to the
standard output. By default, cmp is silent if the files are the same; if they
differ, the byte and line number at which the first difference occurred is
cmp [option..] file1 [file2 [skip1 [skip2]]]
Print differing bytes.
-i SKIP --ignore-initial=SKIP
Skip the first SKIP bytes of input.
-i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2
Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of
Output byte numbers and values of all differing bytes.
-n LIMIT --bytes=LIMIT
Compare at most LIMIT bytes.
-s --quiet --silent
Output nothing; yield exit status only.
Output version info.
--help Output help.
skip1 and skip2 are
the number of bytes to skip in each file. SKIP values may be followed by the
following multiplicative suffixes: kB 1000, K 1024, MB 1,000,000, M 1,048,576,
GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
The offset is decimal by default, but may be expressed as a hex or octal value
by preceding it with a leading `0x' or `0'.
diff will return full
examples for both diff and cmp
a File is - or
missing, read from standard input.
exits with one of the following values:
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. In the latter case, if the -s option has not been
specified, cmp writes to standard output that EOF was reached in the shorter
file (before any differences were found).
>1 An error occurred.