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>

@@ -4,15 +4,15 @@
 
 NAME
        du - summarize disk usage
 
 SYNOPSIS
-       /usr/bin/du [-dorx] [-a | -s] [-h | -k | -m] [-H | -L]
+       /usr/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L]
             [file ...]
 
 
-       /usr/xpg4/bin/du [-dorx] [-a | -s] [-h | -k | -m] [-H | -L]
+       /usr/xpg4/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L]
             [file ...]
 
 
 DESCRIPTION
        The du utility writes to standard output the size of the file space

@@ -22,11 +22,10 @@
        is defined as the sum total of space allocated to all files in the file
        hierarchy rooted in the directory plus the space allocated to the
        directory itself. This sum will include the space allocated to any
        extended attributes encountered.
 
-
        Files with multiple links will be counted and written for only one
        entry. The directory entry that is selected in the report is
        unspecified. By default, file sizes are written in 512-byte units,
        rounded up to the next 512-byte unit.
 

@@ -44,10 +43,17 @@
              not of type directory in the file hierarchy rooted in the
              specified file. Regardless of the presence of the -a option, non-
              directories given as file operands will always be listed.
 
 
+       -A
+             Tally file size using the apparent size of the file instead of
+             the disk blocks it occupies. This option is useful when operating
+             on file systems which employ compression or in the presence of
+             sparse files.
+
+
        -d
              Do not cross filesystem boundaries. For example, the command, du
              -d / reports usage only on the root partition.
 
 

@@ -118,11 +124,10 @@
 
        file
                The path name of a file whose size is to be written. If no file
                is specified, the current directory is used.
 
-
 OUTPUT
        The output from du consists of the amount of the space allocated to a
        file and the name of the file.
 
 USAGE

@@ -138,15 +143,13 @@
        The following exit values are returned:
 
        0
              Successful completion.
 
-
        >0
              An error occurred.
 
-
 ATTRIBUTES
        See attributes(5) for descriptions of the following attributes:
 
    /usr/bin/du
 

@@ -170,20 +173,20 @@
 
 SEE ALSO
        ls(1), stat(2), attributes(5), environ(5), fsattr(5), largefile(5),
        standards(5)
 
-
        System Administration Guide: Basic Administration
 
 NOTES
        A file with two or more links is counted only once. If, however, there
        are links between files in different directories where the directories
        are on separate branches of the file system hierarchy, du will count
        the excess files more than once.
 
+       Files containing holes will result in an incorrect block count. In this
+       case, one may use the -A option to report file sizes by their apparent
+       size instead.
 
-       Files containing holes will result in an incorrect block count.
 
 
-
-                               February 6, 2007                          DU(1)
+                                March 14, 2017                           DU(1)