1 .\" $OpenBSD: cmp.1,v 1.17 2014/01/25 22:08:08 jmc Exp $
2 .\" $NetBSD: cmp.1,v 1.4 1995/09/08 03:22:55 tls Exp $
4 .\" Copyright (c) 1987, 1990, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" This code is derived from software contributed to Berkeley by
8 .\" the Institute of Electrical and Electronics Engineers, Inc.
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93
36 .Dd $Mdocdate: January 25 2014 $
46 .Op Ar skip1 Op Ar skip2
50 utility compares two files of any type and writes the results
51 to the standard output.
54 is silent if the files are the same; if they differ, the byte
55 and line number at which the first difference occurred is reported.
57 Bytes and lines are numbered beginning with one.
59 The options are as follows:
62 Print the byte number (decimal) and the differing
63 byte values (octal) for each difference.
66 Print nothing for differing files; return exit
70 The optional arguments
74 are the byte offsets from the beginning of
78 respectively, where the comparison will begin.
79 The offset is decimal by default, but may be expressed as a hexadecimal
80 or octal value by preceding it with a leading
87 utility exits with one of the following values:
88 .Bl -tag -width Ds -offset indent
90 The files are identical.
92 The files are different; this includes the case
93 where one file is identical to the first part of
95 In the latter case, if the
97 option has not been specified,
99 writes to standard error that
101 was reached in the shorter
102 file (before any differences were found).
113 utility is compliant with the
121 are extensions to that specification.