[-?
@(#)$Id: cmp (AT&T Research) 2010-04-11 $
]
[+NAME?cmp - compare two files]
[+DESCRIPTION?\bcmp\b compares two files \afile1\a and \afile2\a. \bcmp\b writes no output if the files are the same. By default, if the files differ, the byte and line number at which the first difference occurred are written to standard output. Bytes and lines are numbered beginning with 1.]
[+?If \askip1\a or \askip2\a are specified, or the \b-i\b option is specified, initial bytes of the corresponding file are skipped before beginning the compare. The skip values are in bytes or can have a suffix of \bk\b for kilobytes or \bm\b for megabytes.]
[+?If either \afile1\a or \afiles2\a is \b-\b, \bcmp\b uses standard input starting at the current location.]
[b:print-bytes?Print differing bytes as 3 digit octal values.]
[c:print-chars?Print differing bytes as follows: non-space printable characters as themselves; space and control characters as \b^\b followed by a letter of the alphabet; and characters with the high bit set as the lower 7 bit character prefixed by \bM^\b for 7 bit space and non-printable characters and \bM-\b for all other characters. If the 7 bit character encoding is not ASCII then the characters are converted to ASCII to determine \ahigh bit set\a, and if set it is cleared and converted back to the native encoding. Multibyte characters in the current locale are treated as printable characters.]
[d:differences?Print at most \adifferences\a differences using \b--verbose\b output format. \b--differences=0\b is equivalent to \b--silent\b.]#[differences]
[i:ignore-initial|skip?Skip the the first \askip1\a bytes in \afile1\a and the first \askip2\a bytes in \afile2\a. If \askip2\a is omitted then \askip1\a is used.]:[skip1[::skip2]]:=0::0]
[l:verbose?Write the decimal byte number and the differing bytes (in octal) for each difference.]
[n:count|bytes?Compare at most \acount\a bytes.]#[count]
[s:quiet|silent?Write nothing for differing files; return non-zero exit status only.]

file1 file2 [skip1 [skip2]]

[+EXIT STATUS?]
{
[+0?The files or portions compared are identical.]
[+1?The files are different.]
[+>1?An error occurred.]
}
[+SEE ALSO?\bcomm\b(1), \bdiff\b(1), \bcat\b(1)]
