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