| DU(1) | User Commands | DU(1) |
du — summarize
disk usage
du |
[-Adorx] [-a |
-s] [-b |
-h | -k |
-m] [-H |
-L] [file
...] |
/usr/xpg4/bin/du |
[-Adorx] [-a |
-s] [-b |
-h | -k |
-m] [-H |
-L] [file
...] |
The du utility writes to standard output
the size of the file space allocated to, and the size of the file space
allocated to each subdirectory of, the file hierarchy rooted in each of the
specified files. The size of the file space allocated to a file of type
directory 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.
When du cannot obtain file attributes or
read directories (see stat(2)), it will
report an error condition and the final exit status will be affected.
The following options are supported for
/usr/bin/du and
/usr/xpg4/bin/du:
-a-a option,
non-directories given as file operands will always
be listed.-A-b-A since reporting in bytes requires the apparent
file size rather than the allocated block count.-ddu -d
/’ reports usage only on the root
partition.-h-H-k-L-m-o-s is
used.-r/usr/bin/du is silent
if these conditions arise and -r is not specified.
/usr/xpg4/bin/du acts as though
-r is always specified.-s-xSpecifying more than one of the options in the mutually exclusive
pair, -H and -L, is not
considered an error. The last option specified determines the output
format.
Specifying more than one of the options in the mutually exclusive
set of options -h, -k, and
-m is not considered an error. The last option
specified determines the output format.
Specifying -b along with one of
-h, -k, or
-m is considered an error.
The following operand is supported:
The output from du consists of the amount
of the space allocated to a file and the name of the file.
/usr/bin/du uses a TAB character to separate the
fields, whereas /usr/xpg4/bin/du uses a SPACE.
See largefile(7) for the
description of the behavior of du when encountering
files greater than or equal to 2 Gbyte (2^31 bytes).
See environ(7) for
descriptions of the following environment variables that affect the
execution of du: LANG,
LC_ALL, LC_CTYPE,
LC_MESSAGES, and
NLSPATH.
The following exit values are returned:
The command line interface of du is
Committed. The output of du is
Committed.
ls(1), stat(2), attributes(7), environ(7), fsattr(7), largefile(7), standards(7)
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.
| March 18, 2026 | OmniOS |