August 2000
Intermediate to advanced
816 pages
29h 45m
English
cmp
cmp [options] file1 file2 [skip1 [skip2]]
Compare file1 with file2. Use standard input if file1 is - or missing. See also comm and diff. Files can be of any type. skip1 and skip2 are optional offsets in the files at which the comparison is to start.
Print differing bytes as characters.
Ignore the first num bytes of input.
Print offsets and codes of all differing bytes.
Work silently; print nothing, but return exit codes:
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'Read now
Unlock full access