file2. Use standard input if
file2 is -. To begin the comparison from byte offsets other than at the beginning of the files, use the optional arguments
skip2, which specify the byte offsets from the beginning of each file. By default, the value is decimal. To use hexadecimal or octal values, precede them with a leading 0x or 0, respectively. See also
. The exit codes are as follows:
Files are identical.
Files are different.
Files are inaccessible.
Print differing bytes as characters.
Ignore differences in the first
N bytes of input.
Compare at most
limit bytes of input.
For each difference, print the byte number in decimal and the differing bytes in octal.
Work silently; print nothing, but return exit codes.
Output version info.
Print a message if two files are the same (exit code is 0):
cmp -s old new && echo 'no changes'