Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (d - f) du(1)
NAME
du - Displays a summary of disk usage
SYNOPSIS
du [-a | -s][-klrx][-Wuser=username][le ...]
FLAGS
-a Displays disk use for each le. Without -a, du does not report on les, unless they are
listed on the command line.
-k Displays the le sizes in units of 1024 bytes, instead of the default 512-byte units.
-l Allocates blocks, in les with multiple links, evenly among the links. By default, a le
with two or more links is counted only once.
-r Displays an error message when du encounters an inaccessible directory, or an inac-
cessible le when used with -a. This is the default action.
-s Displays only the grand total for each of the specied les, but not for any subdirec-
tories.
-x When evaluating le sizes, evaluates only those les that have the same device as the
le specied by le. In other words, du does not cross mount points.
When two ags are mutually exclusive (such as -a and -s), the last ag you enter on the com-
mand line takes precedence.
HP Extension
-Wuser=username
Species that only the les or directories owned by that user are listed.
DESCRIPTION
The du command displays the number of blocks in all directories (listed recursively) within each
specied directory. When the -a ag is specied, du reports the number of blocks in individual
les. The block count includes the indirect blocks of each le and is in 512-byte units, indepen-
dent of the cluster size used by the system. If no le or directory name is provided, the du com-
mand uses the current directory.
The size of the le space allocated to a directory is dened as the sum total of the space allocated
to all les in the le hierarchy rooted in the directory, plus the space allocated to the directory
itself.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and
NLSPATH environment variables.
EXAMPLES
1. To display the disk usage of a directory tree and each of its subtrees, enter:
du /u/fran
This displays the number of disk blocks in the /u/fran directory and each of its subdirec-
tories.
2. To display the disk usage of each le, enter:
du -a /u/fran
This displays the number of disk blocks contained in each le and subdirectory of
/u/fran. The number shown beside a directory name is the disk usage of that directory
tree. The number shown beside the name of a regular le is the disk usage of that le
527188-007 Hewlett-Packard Company 321