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