cmp command compares two files, and if they differ,
tells the first byte and line number where they differ or reports
that one file is a prefix of the other. Bytes and
lines are numbered starting with 1. The arguments of
are as follows:
cmp options… from-file [to-file [from-skip [to-skip]]]
The file name - is always the standard input.
also uses the standard input if one file name is omitted. The
from-skip and to-skip operands specify how many bytes to
ignore at the start of each file; they are equivalent to the
cmp outputs nothing if the two files have the
same contents. If one file is a prefix of the other,
prints to standard error a message of the following form:
cmp: EOF on shorter-file
cmp prints to standard output a message of the
from-file to-file differ: char byte-number, line line-number
The message formats can differ outside the POSIX locale. Also, POSIX allows the EOF message to be followed by a blank and some additional information.
An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.
|• cmp Options:||Summary of options to |