cmp
¶Below is a summary of all of the options that GNU
cmp
accepts. Most options have two equivalent names, one of
which is a single letter preceded by ‘-’, and the other of which
is a long name preceded by ‘--’. Multiple single letter options
(unless they take an argument) can be combined into a single command
line word: -bl is equivalent to -b -l.
Print the differing bytes. Display each control byte as a ‘^’ followed by an ASCII letter, ‘@’, ‘[’, ‘\’, ‘]’, ‘^’ or ‘_’. Precede each byte with the high bit set with ‘M-’, which stands for “meta”. A control byte is any byte with the high bit clear that does not represent a printable ASCII character including space.
Output a summary of usage and then exit.
Ignore any differences in the first skip bytes of the input files. Treat files with fewer than skip bytes as if they are empty. If skip is of the form from-skip:to-skip, skip the first from-skip bytes of the first input file and the first to-skip bytes of the second.
Output the (decimal) byte numbers and (octal) values of all differing bytes, instead of the default standard output. Each output line contains a differing byte’s number relative to the start of the input, followed by the differing byte values. Byte numbers start at 1. Also, output the EOF message if one file is shorter than the other.
Compare at most count input bytes.
Do not print anything; only return an exit status indicating whether the files differ.
Output version information and then exit.
In the above table, operands that are byte counts are normally decimal, but may be preceded by ‘0’ for octal and ‘0x’ for hexadecimal.
A byte count can be followed by a suffix to specify a multiple of the count. A bare letter, or one followed by ‘iB’, specifies a multiple using powers of 1024. A letter followed by ‘B’ specifies powers of 1000 instead. For example, ‘-n 1M’ and ‘-n 1MiB’ are equivalent to ‘-n 1048576’, whereas ‘-n 1MB’ is equivalent to ‘-n 1000000’.
The following suffixes are defined. Large sizes like 1Q
may be rejected by your computer due to limitations of its arithmetic.
kilobyte: 10^3 = 1000.
kibibyte: 2^{10} = 1024. ‘K’ is special: the SI prefix is ‘k’ and the ISO/IEC 80000-13 prefix is ‘Ki’, but tradition and POSIX use ‘k’ to mean ‘KiB’.
megabyte: 10^6 = 1,000,000.
mebibyte: 2^{20} = 1,048,576.
gigabyte: 10^9 = 1,000,000,000.
gibibyte: 2^{30} = 1,073,741,824.
terabyte: 10^{12} = 1,000,000,000,000.
tebibyte: 2^{40} = 1,099,511,627,776.
petabyte: 10^{15} = 1,000,000,000,000,000.
pebibyte: 2^{50} = 1,125,899,906,842,624.
exabyte: 10^{18} = 1,000,000,000,000,000,000.
exbibyte: 2^{60} = 1,152,921,504,606,846,976.
zettabyte: 10^{21} = 1,000,000,000,000,000,000,000
zebibyte: 2^{70} = 1,180,591,620,717,411,303,424.
yottabyte: 10^{24} = 1,000,000,000,000,000,000,000,000.
yobibyte: 2^{80} = 1,208,925,819,614,629,174,706,176.
ronnabyte: 10^{27} = 1,000,000,000,000,000,000,000,000,000.
robibyte: 2^{90} = 1,237,940,039,285,380,274,899,124,224.
quettabyte: 10^{30} = 1,000,000,000,000,000,000,000,000,000,000.
quebibyte: 2^{100} = 1,267,650,600,228,229,401,496,703,205,376.