Commit | Line | Data |
---|---|---|
d0e4a4f2 KB |
1 | .\" Copyright (c) 1987 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
ea1077d3 | 5 | .\" @(#)cmp.1 6.2 (Berkeley) %G% |
85ae1ebc | 6 | .\" |
0aa1e165 | 7 | .TH CMP 1 "" |
85ae1ebc KM |
8 | .AT 3 |
9 | .SH NAME | |
10 | cmp \- compare two files | |
11 | .SH SYNOPSIS | |
12 | .B cmp | |
13 | [ | |
14 | .B \-l | |
15 | ] [ | |
16 | .B \-s | |
d0e4a4f2 | 17 | ] file1 file2 [ skip1 [ skip2 ]] |
85ae1ebc | 18 | .SH DESCRIPTION |
d0e4a4f2 KB |
19 | The two files are compared. (If \fIfile1\fP is `\-', the standard |
20 | input is used.) With no options, \fIcmp\fP makes no comment if the | |
21 | files are the same; if they differ, it reports the byte and line | |
22 | number at which the difference occurred, or, that one file is an | |
23 | initial subsequence of the other. \fISkip1\fP and \fIskip2\fP are | |
24 | initial byte offsets into \fIfile1\fP and \fIfile2\fP respectively, | |
25 | and may be either octal or decimal; a leading ``0'' denotes octal. | |
85ae1ebc KM |
26 | .PP |
27 | Options: | |
28 | .TP 6 | |
d0e4a4f2 KB |
29 | .B \-s |
30 | Print nothing for differing files; set exit codes only. | |
85ae1ebc | 31 | .TP 6 |
d0e4a4f2 KB |
32 | .B \-l |
33 | Print the byte number (in decimal) and the differing bytes (in octal) | |
34 | for all differences between the two files. | |
85ae1ebc KM |
35 | .SH "SEE ALSO" |
36 | diff(1), comm(1) | |
37 | .SH DIAGNOSTICS | |
d0e4a4f2 KB |
38 | Exit code 0 is returned for identical files, 1 for different files, |
39 | and 2 for an inaccessible or missing argument, or a system error. |