Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
cmp(1)
Edit
PageHistory
Diff
Info
LikePages
CMP !!!CMP NAME SYNOPSIS DESCRIPTION BYTE RANGES NOTES DIAGNOSTICS SEE ALSO STANDARDS ---- !!NAME cmp (GNU diffutils) - compare two files or byte ranges !!SYNOPSIS __cmp__ [[-clsv] [[-i NUM] [[--help] [[--print-chars] [[--ignore-initial=NUM] [[--verbose] [[--quiet] [[--silent] [[--version] -I FILE1 [[FILE2 [[RANGE1 [[RANGE2]]] !!DESCRIPTION The __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: __-c, --print-chars__ Output the differing bytes as characters, rather than as octal numbers. Non-printable characters will be shown in form. __-i NUM, --ignore-initial=NUM__ Ignore ''NUM'' initial characters from each file. This is a synonym for specifying ''NUM NUM'' as the two ''RANGE'' arguments. __-l, --verbose__ Print the byte number (decimal) and the differing byte values (octal) for each difference. __-s, --quiet, --silent__ Print nothing for differing files; return exit status only. __-v, --version__ Print the __diffutils__ version number. !!BYTE RANGES The two optional arguments ''RANGE1'' and ''RANGE2'' represent byte ranges to compare within the files. Each range can be expressed in several ways: __M+N__ Skip ''M'' bytes at the beginning of the input, then compare a maximum of ''N'' bytes. __M-N, M,N__ Skip ''M'' bytes at the beginning of the input, and read between bytes ''M'' and ''N'', which are both zero-based. 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. !!NOTES The 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 __N'' bytes ''N'' is zero-based. !!DIAGNOSTICS The __cmp__ utility exits with one of the following values: __0__ The files or byte ranges are identical. __1__ The files or byte ranges are different; this includes the case where one file or range is identical to the first part of the other. In the latter case, if __-s__ has not been specified, __cmp__ writes to standard output that EOF was reached in the shorter file. ____ An error occurred. !!SEE ALSO diff(1), diff3(1) !!STANDARDS The __cmp__ utility is expected to be ''POSIX 1003.2''-compliant. ----
7 pages link to
cmp(1)
:
Man1c
bzdiff(1)
diff(1)
diff3(1)
sdiff(1)
zcmp(1)
zdiff(1)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.