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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.