cmp
Checks whether two files differ
cmp [options] file1 [file2]
The cmp utility does a byte-by-byte comparison of file1 and file2. If the files differ, cmp outputs the location at which the first difference occurs. Unlike diff (page 1149), cmp works with binary as well as ASCII files.
The cmp utility returns an exit status of 0 if the files are the same and 1 if they are different. An exit status > 2 means that an error occurred.
Arguments
The file1 and file2 arguments identify the two files to compare. If file2 is omitted, cmp uses standard input instead. Using a filename of - for either file1 or file2 causes cmp to read standard input in place of that file.
Options
--ignore-initial=n
-i n Skips the first n bytes in both files before beginning ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access