Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

User Commands (d - f) du(1)
NAME
du - Displays a summary of disk usage
SYNOPSIS
du [-a | -s][-klrx][-Wuser=username][file ...]
FLAGS
-a Displays disk use for each file. Without -a, du does not report on files, unless they are
listed on the command line.
-k Displays the file sizes in units of 1024 bytes, instead of the default 512-byte units.
-l Allocates blocks, in files with multiple links, evenly among the links. By default, a file
with two or more links is counted only once.
-r Displays an error message when du encounters an inaccessible directory, or an inac-
cessible file when used with -a. This is the default action.
-s Displays only the grand total for each of the specified files, but not for any subdirec-
tories.
-x When evaluating file sizes, evaluates only those files that have the same device as the
file specified by file. In other words, du does not cross mount points.
When two flags are mutually exclusive (such as -a and -s), the last flag you enter on the com-
mand line takes precedence.
HP Extension
-Wuser=username
Specifies that only the files or directories owned by that user are listed.
DESCRIPTION
The du command displays the number of blocks in all directories (listed recursively) within each
specified directory. When the -a flag is specified, du reports the number of blocks in individual
files. The block count includes the indirect blocks of each file and is in 512-byte units, indepen-
dent of the cluster size used by the system. If no file or directory name is provided, the du com-
mand uses the current directory.
The size of the file space allocated to a directory is defined as the sum total of the space allocated
to all files in the file 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 file, enter:
du -a /u/fran
This displays the number of disk blocks contained in each file 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 file is the disk usage of that file
527188-021 Hewlett-Packard Company 321