September 2009
Beginner
942 pages
85h 34m
English
cmp
cmp [options]file1 file2[skip1[skip2]]
Compare file1 with file2. Use standard input if file1 is - or missing. This command is normally used for comparing binary files, although files can be of any type. (See also diff.) skip1 and skip2 are optional offsets in the files at which the comparison is to start.
Ignore the first num bytes of input. num can be given as num1:num2 to skip a different number of bytes in file1 and file2.
Print offsets and codes of all differing bytes.
Work silently; print nothing, return an exit code:
Files are identical.
Files are different.
Files are inaccessible.
Print a message if two files are the same (exit code is 0):
cmp -s old new && echo 'no changes'