diffutils: Invoking cmp
1
1 12 Invoking 'cmp'
1 *****************
1
1 The 'cmp' command compares two files, and if they differ, tells the
1 first byte and line number where they differ or reports that one file is
1 a prefix of the other. Bytes and lines are numbered starting with 1.
1 The arguments of 'cmp' are as follows:
1
1 cmp OPTIONS... FROM-FILE [TO-FILE [FROM-SKIP [TO-SKIP]]]
1
1 The file name '-' is always the standard input. 'cmp' also uses the
1 standard input if one file name is omitted. The FROM-SKIP and TO-SKIP
1 operands specify how many bytes to ignore at the start of each file;
1 they are equivalent to the '--ignore-initial=FROM-SKIP:TO-SKIP' option.
1
1 By default, 'cmp' outputs nothing if the two files have the same
1 contents. If the two files have bytes that differ, 'cmp' reports the
1 location of the first difference to standard output:
1
1 FROM-FILE TO-FILE differ: char BYTE-NUMBER, line LINE-NUMBER
1
1 If one file is a prefix of the other, 'cmp' reports the shorter file's
1 name to standard error, followed by a blank and extra information about
1 the shorter file:
1
1 cmp: EOF on SHORTER-FILE EXTRA-INFO
1
1 The message formats can differ outside the POSIX locale. POSIX
1 allows but does not require the EOF diagnostic's file name to be
1 followed by a blank and additional information.
1
1 An exit status of 0 means no differences were found, 1 means some
1 differences were found, and 2 means trouble.
1
Menu