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

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/cmp.1.man.txt
          +++ new/usr/src/man/man1/cmp.1.man.txt
   1    1  CMP(1)                           User Commands                          CMP(1)
   2    2  
   3      -
   4      -
   5    3  NAME
   6      -       cmp - compare two files
        4 +     cmp - compare two files
   7    5  
   8    6  SYNOPSIS
   9      -       cmp [-l | -s] file1 file2 [skip1] [skip2]
        7 +     cmp [-bcdilns] file1 file2 [skip1 [skip2]]
  10    8  
  11      -
  12    9  DESCRIPTION
  13      -       The cmp utility compares two files. cmp writes no output if the files
  14      -       are the same. Under default options, if they differ, it writes to
  15      -       standard output the byte and line numbers at which the first difference
  16      -       occurred. Bytes and lines are numbered beginning with 1. If one file is
  17      -       an initial subsequence of the other, that fact is noted. skip1 and
  18      -       skip2 are initial byte offsets into file1 and file2 respectively, and
  19      -       can be either octal or decimal. A leading 0 denotes octal.
       10 +     The cmp utility compares two files.  cmp writes no output if the files
       11 +     are the same.  Under default options, if they differ, it writes to
       12 +     standard output the byte and line numbers at which the first difference
       13 +     occurred.  Bytes and lines are numbered beginning with 1.  skip1 and
       14 +     skip2 are initial byte offsets into file1 and file2 respectively, and are
       15 +     specified in bytes or can be given with a suffix of k for kilobytes or m
       16 +     for megabytes.
  20   17  
       18 +     If either file1 or file2 is a dash (-), cmp uses standard input starting
       19 +     at the current location.
       20 +
  21   21  OPTIONS
  22      -       The following options are supported:
       22 +     The following options are supported:
  23   23  
  24      -       -l
  25      -             Write the byte number (decimal) and the differing bytes (octal)
  26      -             for each difference.
       24 +     -b, --print-bytes
       25 +                   Print differing bytes as 3-digit octal values.
  27   26  
       27 +     -c, --print-chars
       28 +                   Print differing bytes as follows:
  28   29  
  29      -       -s
  30      -             Write nothing for differing files. Return exit status only.
       30 +                   o       non-space printable characters as themselves;
  31   31  
       32 +                   o       space and control characters as ^ followed by a
       33 +                           letter of the alphabet;
  32   34  
  33      -OPERANDS
  34      -       The following operands are supported:
       35 +                   o       characters with the high bit set as the lower 7-bit
       36 +                           character prefixed by M^ for 7-bit space and non-
       37 +                           printable characters, and M- for all other
       38 +                           characters.  If the 7-bit character encoding is not
       39 +                           ASCII then the characters are converted to ASCII to
       40 +                           determine whether the high bit is set and, if set,
       41 +                           it is cleared and converted back to the native
       42 +                           encoding.  Multibyte characters in the current
       43 +                           locale are treated as printable characters.
  35   44  
  36      -       file1
  37      -                A path name of the first file to be compared. If file1 is -,
  38      -                the standard input is used.
       45 +     -d differences, --differences=differences
       46 +                   Print at most differences differences using -l (--verbose)
       47 +                   output format.  If differences is 0 then this is equivalent
       48 +                   to passing the -s or --silent option.
  39   49  
       50 +     -i skip1[:skip2, --skip=skip1[:skip2, --ignore-initial=skip1[:skip2]]]
       51 +                   Skip the first skip1 bytes in file1 and the first skip2
       52 +                   bytes in file2.  If skip2 is omitted then skip1 is used for
       53 +                   that value.  The default value is 0:0.
  40   54  
  41      -       file2
  42      -                A path name of the second file to be compared. If file2 is -,
  43      -                the standard input is used.
       55 +     -l, --verbose
       56 +                   Write the byte number (decimal) and the differing bytes
       57 +                   (octal) for each difference.
  44   58  
       59 +     -n count, --count=count, --bytes=count
       60 +                   Compare at most count bytes.
  45   61  
       62 +     -s, --silent -, --quiet
       63 +                   Write nothing for differing files.  Return exit status
       64 +                   only.
  46   65  
  47      -       If both file1 and file2 refer to standard input or refer to the same
  48      -       FIFO special, block special or character special file, an error
  49      -       results.
       66 +OPERANDS
       67 +     The following operands are supported:
  50   68  
  51      -USAGE
  52      -       See largefile(5) for the description of the behavior of cmp when
  53      -       encountering files greater than or equal to 2 Gbyte (2^31 bytes).
       69 +     file1         A path name of the first file to be compared.  If file1 is
       70 +                   -, the standard input is used.
  54   71  
  55      -EXAMPLES
  56      -       Example 1 Comparing Files Byte for Byte
       72 +     file2         A path name of the second file to be compared.  If file2 is
       73 +                   -, the standard input is used.
  57   74  
       75 +     skip1         The number of initial bytes from file1 to skip before
       76 +                   beginning the comparison.
  58   77  
  59      -       The following example does a byte for byte comparison of file1 and
  60      -       file2:
       78 +     skip2         The number of initial bytes from file2 to skip before
       79 +                   beginning the comparison.  If skip1 is specified but skip2
       80 +                   is not, then the value of skip1 is also implicitly used for
       81 +                   skip2.
  61   82  
       83 +     If both file1 and file2 refer to standard input or refer to the same
       84 +     FIFO, block or character special file, an error results.
  62   85  
  63      -         example% cmp file1 file2 0 1024
       86 +     skip values are specified in bytes, or can be suffixed with k (for
       87 +     kilobytes) or m (for megabytes.)
  64   88  
  65      -
  66      -
  67      -
  68      -       It skips the first 1024 bytes in file2 before starting the comparison.
  69      -
  70      -
  71      -ENVIRONMENT VARIABLES
  72      -       See environ(5) for descriptions of the following environment variables
  73      -       that affect the execution of cmp: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
  74      -       and NLSPATH.
  75      -
  76   89  EXIT STATUS
  77      -       The following error values are returned:
       90 +     The following exit values are returned:
  78   91  
  79      -       0
  80      -             The files are identical.
       92 +     0       The files or portions compared are identical.
  81   93  
       94 +     1       The files or portions compared are different.
  82   95  
  83      -       1
  84      -             The files are different. This includes the case where one file is
  85      -             identical to the first part of the other.
       96 +     >1      An error ocurred.
  86   97  
       98 +EXAMPLES
       99 +     Example 1 Comparing Files Byte for Byte
      100 +             The following example does a byte for byte comparison of file1
      101 +             and file2, skipping the first 1024 bytes in file2 before starting
      102 +             the comparison.
  87  103  
  88      -       >1
  89      -             An error occurred.
      104 +             $ cmp file1 file2 0 1024
  90  105  
      106 +ENVIRONMENT VARIABLES
      107 +     See environ(5) for descriptions of the following environment variables
      108 +     that affect the execution of cmp: LANG, LC_ALL, LC_TYPE, LC_MESSAGES,
      109 +     LC_NUMERIC, and NLSPATH.
  91  110  
  92      -ATTRIBUTES
  93      -       See attributes(5) for descriptions of the following attributes:
      111 +INTERFACE STABILITY
      112 +     The command line interface of cmp is Committed.  The output of cmp is
      113 +     Standard.
  94  114  
  95      -
  96      -
  97      -
  98      -       +--------------------+-----------------+
  99      -       |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 100      -       +--------------------+-----------------+
 101      -       |CSI                 | Enabled         |
 102      -       +--------------------+-----------------+
 103      -       |Interface Stability | Standard        |
 104      -       +--------------------+-----------------+
 105      -
 106  115  SEE ALSO
 107      -       comm(1), diff(1), attributes(5), environ(5), largefile(5), standards(5)
      116 +     comm(1), diff(1), attributes(5), environ(5), largefile(5), standards(5)
 108  117  
 109      -
 110      -
 111      -                                 July 19, 2006                          CMP(1)
      118 +illumos                        February 9, 2021                        illumos
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX