CMP(1) | General Commands Manual | CMP(1) |
cmp
— compare two
files
cmp |
[-ls ] [-n
max_bytes] file1
file2 |
The cmp
utility checks files
file1 and file2 for a different
byte and prints it out.
The following options are supported:
When a difference is found, the default message format is:
When -l
is passed, the format is:
When -s
is passed, nothing should be
printed to standard output.
If -s
is not passed, and a file is shorter
than the other, an error with the following format is printed:
Note that unlike the other formats, only the following format is standard:
cmp
should be compliant with the IEEE Std
1003.1-2024 (“POSIX.1”) specification. The
-n
max_bytes option is an
extension.
Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
2024-05-02 | Linux 6.6.67-gentoo-x86_64 |