cmp — Compare Two Files

Synopsis

/usr/bin/cmp [-l] [-s] file1 file2 [skip1] [skip2] 

Description

Use the cmp command to compare two files. If the files are the same, cmp writes no output. Under default options, if the files differ, cmp writes to standard output the byte and line numbers at which the first difference occurred. Bytes and lines are numbered beginning with 1. If one file is an initial subsequence of the other, that fact is noted. skip1 and skip2 are initial byte offsets into file1 and file2 , and may be either octal or decimal; a leading 0 denotes octal.

Options

-l Write the byte number (decimal) and the differing bytes (octal) for each difference.
-s Write nothing for differing files; return exit statuses only.

Operands

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.