Print this page
13507 some man pages need update following 13405
6308 some man pages are obsolete after moving to ksh builtins

@@ -1,111 +1,118 @@
 CMP(1)                           User Commands                          CMP(1)
 
-
-
 NAME
        cmp - compare two files
 
 SYNOPSIS
-       cmp [-l | -s] file1 file2 [skip1] [skip2]
+     cmp [-bcdilns] file1 file2 [skip1 [skip2]]
 
-
 DESCRIPTION
        The cmp utility compares two files. cmp writes no output if the files
        are the same. Under default options, if they differ, it 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 respectively, and
-       can be either octal or decimal. A leading 0 denotes octal.
+     occurred.  Bytes and lines are numbered beginning with 1.  skip1 and
+     skip2 are initial byte offsets into file1 and file2 respectively, and are
+     specified in bytes or can be given with a suffix of k for kilobytes or m
+     for megabytes.
 
+     If either file1 or file2 is a dash (-), cmp uses standard input starting
+     at the current location.
+
 OPTIONS
        The following options are supported:
 
-       -l
-             Write the byte number (decimal) and the differing bytes (octal)
-             for each difference.
+     -b, --print-bytes
+                   Print differing bytes as 3-digit octal values.
 
+     -c, --print-chars
+                   Print differing bytes as follows:
 
-       -s
-             Write nothing for differing files. Return exit status only.
+                   o       non-space printable characters as themselves;
 
+                   o       space and control characters as ^ followed by a
+                           letter of the alphabet;
 
-OPERANDS
-       The following operands are supported:
+                   o       characters with the high bit set as the lower 7-bit
+                           character prefixed by M^ for 7-bit space and non-
+                           printable characters, and M- for all other
+                           characters.  If the 7-bit character encoding is not
+                           ASCII then the characters are converted to ASCII to
+                           determine whether the high bit is set and, if set,
+                           it is cleared and converted back to the native
+                           encoding.  Multibyte characters in the current
+                           locale are treated as printable characters.
 
-       file1
-                A path name of the first file to be compared. If file1 is -,
-                the standard input is used.
+     -d differences, --differences=differences
+                   Print at most differences differences using -l (--verbose)
+                   output format.  If differences is 0 then this is equivalent
+                   to passing the -s or --silent option.
 
+     -i skip1[:skip2, --skip=skip1[:skip2, --ignore-initial=skip1[:skip2]]]
+                   Skip the first skip1 bytes in file1 and the first skip2
+                   bytes in file2.  If skip2 is omitted then skip1 is used for
+                   that value.  The default value is 0:0.
 
-       file2
-                A path name of the second file to be compared. If file2 is -,
-                the standard input is used.
+     -l, --verbose
+                   Write the byte number (decimal) and the differing bytes
+                   (octal) for each difference.
 
+     -n count, --count=count, --bytes=count
+                   Compare at most count bytes.
 
+     -s, --silent -, --quiet
+                   Write nothing for differing files.  Return exit status
+                   only.
 
-       If both file1 and file2 refer to standard input or refer to the same
-       FIFO special, block special or character special file, an error
-       results.
+OPERANDS
+     The following operands are supported:
 
-USAGE
-       See largefile(5) for the description of the behavior of cmp when
-       encountering files greater than or equal to 2 Gbyte (2^31 bytes).
+     file1         A path name of the first file to be compared.  If file1 is
+                   -, the standard input is used.
 
-EXAMPLES
-       Example 1 Comparing Files Byte for Byte
+     file2         A path name of the second file to be compared.  If file2 is
+                   -, the standard input is used.
 
+     skip1         The number of initial bytes from file1 to skip before
+                   beginning the comparison.
 
-       The following example does a byte for byte comparison of file1 and
-       file2:
+     skip2         The number of initial bytes from file2 to skip before
+                   beginning the comparison.  If skip1 is specified but skip2
+                   is not, then the value of skip1 is also implicitly used for
+                   skip2.
 
+     If both file1 and file2 refer to standard input or refer to the same
+     FIFO, block or character special file, an error results.
 
-         example% cmp file1 file2 0 1024
+     skip values are specified in bytes, or can be suffixed with k (for
+     kilobytes) or m (for megabytes.)
 
+EXIT STATUS
+     The following exit values are returned:
 
+     0       The files or portions compared are identical.
 
+     1       The files or portions compared are different.
 
-       It skips the first 1024 bytes in file2 before starting the comparison.
+     >1      An error ocurred.
 
+EXAMPLES
+     Example 1 Comparing Files Byte for Byte
+             The following example does a byte for byte comparison of file1
+             and file2, skipping the first 1024 bytes in file2 before starting
+             the comparison.
 
+             $ cmp file1 file2 0 1024
+
 ENVIRONMENT VARIABLES
        See environ(5) for descriptions of the following environment variables
-       that affect the execution of cmp: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
-       and NLSPATH.
+     that affect the execution of cmp: LANG, LC_ALL, LC_TYPE, LC_MESSAGES,
+     LC_NUMERIC, and NLSPATH.
 
-EXIT STATUS
-       The following error values are returned:
+INTERFACE STABILITY
+     The command line interface of cmp is Committed.  The output of cmp is
+     Standard.
 
-       0
-             The files are identical.
-
-
-       1
-             The files are different. This includes the case where one file is
-             identical to the first part of the other.
-
-
-       >1
-             An error occurred.
-
-
-ATTRIBUTES
-       See attributes(5) for descriptions of the following attributes:
-
-
-
-
-       +--------------------+-----------------+
-       |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
-       +--------------------+-----------------+
-       |CSI                 | Enabled         |
-       +--------------------+-----------------+
-       |Interface Stability | Standard        |
-       +--------------------+-----------------+
-
 SEE ALSO
        comm(1), diff(1), attributes(5), environ(5), largefile(5), standards(5)
 
-
-
-                                 July 19, 2006                          CMP(1)
+illumos                        February 9, 2021                        illumos