added "more" command
[unix-history] / usr / src / usr.bin / cmp / cmp.1
CommitLineData
0aa1e165 1.\" @(#)cmp.1 6.1 (Berkeley) %G%
85ae1ebc 2.\"
0aa1e165 3.TH CMP 1 ""
85ae1ebc
KM
4.AT 3
5.SH NAME
6cmp \- compare two files
7.SH SYNOPSIS
8.B cmp
9[
10.B \-l
11] [
12.B \-s
13]
14file1 file2
15.SH DESCRIPTION
16The two files are
17compared.
18(If
19.I file1
20is `\-',
21the standard input is used.)
22Under default options,
23.I cmp
24makes no comment if the files are the same;
25if they differ, it announces the byte and line number
26at which the difference occurred.
27If one file is an initial subsequence
28of the other, that fact is noted.
29.PP
30Options:
31.TP 6
32.B \-l
33Print the byte number (decimal) and the
34differing bytes (octal) for each difference.
35.TP 6
36.B \-s
37Print nothing for differing files;
38return codes only.
39.dt
40.SH "SEE ALSO"
41diff(1), comm(1)
42.SH DIAGNOSTICS
43Exit code 0 is returned for identical
44files, 1 for different files, and 2 for an
45inaccessible or missing argument.