Manual / cmp
cmp(1)
| CMP(1) | General Commands Manual | CMP(1) |
NAME
cmp - compare two files
SYNOPSIS
cmp [-l|-s] file1 file2
DESCRIPTION
The two files are compared for identical contents. By default, a discrepancy is noted by giving the first differing byte number and line number, both counted from 1. If one file is a prefix of the other, an end-of-file diagnostic is printed.
- -l
- List every differing byte: decimal position and the two octal byte values.
- -s
- Suppress ordinary difference reports. Open and usage errors still appear.
The two options are mutually exclusive.
FILES
/usr/man/CMP this page
SEE ALSO
DIAGNOSTICS
Exit status is 0 for identical files, 1 for different files, 2 for a usage or open error.
BUGS
The byte position and line counters are 24-bit, which is exact for every file maux can open (a file's length is a 3-byte field, at most 16,777,215 bytes).
| October 25, 2026 | maux |