BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / cmp.0
CMP(1) UNIX Programmer's Manual CMP(1)
N\bNA\bAM\bME\bE
cmp - compare two files
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
c\bcm\bmp\bp [ -\b-l\bl ] [ -\b-s\bs ] file1 file2 [ skip1 ] [ skip2 ]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The two files are compared. (If _\bf_\bi_\bl_\be_\b1 is `-', the standard
input is used.) With no options, _\bc_\bm_\bp makes no comment if
the files are the same; if they differ, it reports the byte
and line number at which the difference occurred, or, that
one file is an initial subsequence of the other. _\bS_\bk_\bi_\bp_\b1 and
_\bs_\bk_\bi_\bp_\b2 are initial byte offsets into _\bf_\bi_\bl_\be_\b1 and _\bf_\bi_\bl_\be_\b2 respec-
tively, and may be either octal or decimal; a leading ``0''
denotes octal.
Options:
-\b-s\bs Print nothing for differing files; set exit codes
only.
-\b-l\bl Print the byte number (in decimal) and the differing
bytes (in octal) for all differences between the two
files.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
diff(1), comm(1)
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
Exit code 0 is returned for identical files, 1 for different
files, and 2 for an inaccessible or missing argument, or a
system error.
Printed 7/9/88 November 18, 1987 1