Print this page
7967 Want apparent size option for du(1)
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man1/du.1.man.txt
          +++ new/usr/src/man/man1/du.1.man.txt
   1    1  DU(1)                            User Commands                           DU(1)
   2    2  
   3    3  
   4    4  
   5    5  NAME
   6    6         du - summarize disk usage
   7    7  
   8    8  SYNOPSIS
   9      -       /usr/bin/du [-dorx] [-a | -s] [-h | -k | -m] [-H | -L]
        9 +       /usr/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L]
  10   10              [file ...]
  11   11  
  12   12  
  13      -       /usr/xpg4/bin/du [-dorx] [-a | -s] [-h | -k | -m] [-H | -L]
       13 +       /usr/xpg4/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L]
  14   14              [file ...]
  15   15  
  16   16  
  17   17  DESCRIPTION
  18   18         The du utility writes to standard output the size of the file space
  19   19         allocated to, and the size of the file space allocated to each
  20   20         subdirectory of, the file hierarchy rooted in each of the specified
  21   21         files. The size of the file space allocated to a file of type directory
  22   22         is defined as the sum total of space allocated to all files in the file
  23   23         hierarchy rooted in the directory plus the space allocated to the
  24   24         directory itself. This sum will include the space allocated to any
  25   25         extended attributes encountered.
  26   26  
  27      -
  28   27         Files with multiple links will be counted and written for only one
  29   28         entry. The directory entry that is selected in the report is
  30   29         unspecified. By default, file sizes are written in 512-byte units,
  31   30         rounded up to the next 512-byte unit.
  32   31  
  33   32     /usr/xpg4/bin/du
  34   33         When du cannot obtain file attributes or read directories (see
  35   34         stat(2)), it will report an error condition and the final exit status
  36   35         will be affected.
  37   36  
↓ open down ↓ 1 lines elided ↑ open up ↑
  39   38         The following options are supported for /usr/bin/du and
  40   39         /usr/xpg4/bin/du:
  41   40  
  42   41         -a
  43   42               In addition to the default output, report the size of each file
  44   43               not of type directory in the file hierarchy rooted in the
  45   44               specified file. Regardless of the presence of the -a option, non-
  46   45               directories given as file operands will always be listed.
  47   46  
  48   47  
       48 +       -A
       49 +             Tally file size using the apparent size of the file instead of
       50 +             the disk blocks it occupies. This option is useful when operating
       51 +             on file systems which employ compression or in the presence of
       52 +             sparse files.
       53 +
       54 +
  49   55         -d
  50   56               Do not cross filesystem boundaries. For example, the command, du
  51   57               -d / reports usage only on the root partition.
  52   58  
  53   59  
  54   60         -h
  55   61               All sizes are scaled to a human readable format, for example,
  56   62               14K, 234M, 2.7G, or 3.0T. Scaling is done by repetitively
  57   63               dividing by 1024.
  58   64  
↓ open down ↓ 54 lines elided ↑ open up ↑
 113  119         of options -h, -k, and -m is not considered an error.  The last option
 114  120         specified determines the output format.
 115  121  
 116  122  OPERANDS
 117  123         The following operand is supported:
 118  124  
 119  125         file
 120  126                 The path name of a file whose size is to be written. If no file
 121  127                 is specified, the current directory is used.
 122  128  
 123      -
 124  129  OUTPUT
 125  130         The output from du consists of the amount of the space allocated to a
 126  131         file and the name of the file.
 127  132  
 128  133  USAGE
 129  134         See largefile(5) for the description of the behavior of du when
 130  135         encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
 131  136  
 132  137  ENVIRONMENT VARIABLES
 133  138         See environ(5) for descriptions of the following environment variables
 134  139         that affect the execution of du: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
 135  140         and NLSPATH.
 136  141  
 137  142  EXIT STATUS
 138  143         The following exit values are returned:
 139  144  
 140  145         0
 141  146               Successful completion.
 142  147  
 143      -
 144  148         >0
 145  149               An error occurred.
 146  150  
 147      -
 148  151  ATTRIBUTES
 149  152         See attributes(5) for descriptions of the following attributes:
 150  153  
 151  154     /usr/bin/du
 152  155  
 153  156         +--------------------+-----------------+
 154  157         |  ATTRIBUTE TYPE    | ATTRIBUTE VALUE |
 155  158         +--------------------+-----------------+
 156  159         |CSI                 | Enabled         |
 157  160         +--------------------+-----------------+
↓ open down ↓ 7 lines elided ↑ open up ↑
 165  168         +--------------------+-----------------+
 166  169         |CSI                 | Enabled         |
 167  170         +--------------------+-----------------+
 168  171         |Interface Stability | Standard        |
 169  172         +--------------------+-----------------+
 170  173  
 171  174  SEE ALSO
 172  175         ls(1), stat(2), attributes(5), environ(5), fsattr(5), largefile(5),
 173  176         standards(5)
 174  177  
 175      -
 176  178         System Administration Guide: Basic Administration
 177  179  
 178  180  NOTES
 179  181         A file with two or more links is counted only once. If, however, there
 180  182         are links between files in different directories where the directories
 181  183         are on separate branches of the file system hierarchy, du will count
 182  184         the excess files more than once.
 183  185  
      186 +       Files containing holes will result in an incorrect block count. In this
      187 +       case, one may use the -A option to report file sizes by their apparent
      188 +       size instead.
 184  189  
 185      -       Files containing holes will result in an incorrect block count.
 186  190  
 187  191  
 188      -
 189      -                               February 6, 2007                          DU(1)
      192 +                                March 14, 2017                           DU(1)
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX