Manpages CMPSection: User Commands (1)Updated: 1998 September 23 Index Return to Main Contents NAMEcmp (GNU diffutils) - compare two files or byte rangesSYNOPSIScmp [-clsv] [-i NUM] [--help] [--print-chars] [--ignore-initial=NUM] [--verbose] [--quiet] [--silent] [--version] -I FILE1 [FILE2 [RANGE1 [RANGE2]]]DESCRIPTIONThe cmp utility compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported. In the output, bytes and lines are numbered beginning with one; however, range inputs are zero-based; see below for details. A filename of - represents standard input. The following options are available:
BYTE RANGESThe two optional arguments RANGE1 and RANGE2 represent byte ranges to compare within the files. Each range can be expressed in several ways:
In either case, both M and N are optional and default to beginning and end of file, respectively. In addition, they can be expressed in decimal, octal (0NNN) or hexadecimal (0xNNN) form. NOTESThe zero-based range numbers may seem inconsistent with cmp output, which is one-based; this is for compatibility with some versions of cmp which allow "skip N bytes" parameters after the filenames; in this context, the N is zero-based.DIAGNOSTICSThe cmp utility exits with one of the following values:
SEE ALSOdiff(1), diff3(1)STANDARDSThe cmp utility is expected to be POSIX 1003.2-compliant.
IndexThis document was created by man2html, using the manual pages. Time: 21:33:45 GMT, July 06, 2025 |