43 lines
786 B
Groff
43 lines
786 B
Groff
.TH CMP 1
|
|
.SH NAME
|
|
cmp \- compare two files
|
|
.SH SYNOPSIS
|
|
\fBcmp\fR [\fB\-ls\fR] \fIfile1 file2\fR
|
|
.br
|
|
.de FL
|
|
.TP
|
|
\\fB\\$1\\fR
|
|
\\$2
|
|
..
|
|
.de EX
|
|
.TP 20
|
|
\\fB\\$1\\fR
|
|
# \\$2
|
|
..
|
|
.SH OPTIONS
|
|
.TP 5
|
|
.B \-l
|
|
# Loud mode. Print bytes that differ (in octal)
|
|
.TP 5
|
|
.B \-s
|
|
# Silent mode. Print nothing, just return exit status
|
|
.SH EXAMPLES
|
|
.TP 20
|
|
.B cmp file1 file2
|
|
# Tell whether the files are the same
|
|
.TP 20
|
|
.B cmp \-l file1 file2
|
|
# Print all corresponding bytes that differ
|
|
.SH DESCRIPTION
|
|
.PP
|
|
Two files are compared.
|
|
If they are identical, exit status 0 is returned.
|
|
If they differ, exit status 1 is returned.
|
|
If the files cannot be opened, exit status 2 is returned.
|
|
If one of the file arguments is \-, then
|
|
\fIstdin\fR is compared to
|
|
the other file.
|
|
.SH "SEE ALSO"
|
|
.BR comm (1),
|
|
.BR diff (1).
|