DU(1,C) AIX Commands Reference DU(1,C)
-------------------------------------------------------------------------------
du
PURPOSE
Summarizes disk usage.
SYNTAX
+-----------+ +------ . ------+
du ---| +-------+ |---| +-----------+ |---|
+-| -a -r |-+ +-| file |-+
^| -l -s || ^| directory ||
|+-------+| |+-----------+|
+---------+ +-------------+
DESCRIPTION
The du command gives the number of blocks in all files and (recursively)
directories within each specified directory. By specifying the -a flag, you
can also have the du command report the number of blocks in individual files.
The block count includes the indirect blocks of each file and is in units of
1024 bytes. If you provide no file or directory name, the du command uses the
current directory.
When encountering a symbolic link, du will report the size of the symbolic link
itself, rather than reporting the size of the file or directory to which it
points.
Notes:
1. If you do not specify the -a flag, the du command does not report on any
files.
2. If there are too many distinctly linked files, the du command counts the
excess files more than once.
3. AIX allocates 4096-byte disk blocks and therefore du will always report
file sizes multiples of 4 1024-byte blocks. For example, a file which is
2048 bytes long will be reported as using 4 blocks.
4. AIX uses a disk block allocation strategy such that no blocks are
allocated for files of 384 or fewer bytes. du reports these files as using
0 disk blocks.
FLAGS
Processed November 8, 1990 DU(1,C) 1
DU(1,C) AIX Commands Reference DU(1,C)
-a Displays disk use for each file.
-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 Indicates inaccessible files and directories.
-s Displays only the grand total (for each of the specified files or
directories given).
EXAMPLES
1. To summarize the disk usage of a directory tree and each of its subtrees:
du /u/fran
For "/u/fran" and each of its subdirectories, this command displays the
number of disk blocks that the files in the tree beneath it contain.
2. To display the disk usage of each file:
du -a /u/fran
This command displays the number of disk blocks contained in each file and
subdirectory of "/u/fran". The number beside a directory is the disk usage
of that directory tree. The number beside a regular file is the disk usage
of that file alone.
3. To display only the total disk usage of a directory tree:
du -rs /u/fran
This command displays only the sum total disk usage of "/u/fran" and the
files it contains ("-s"). The -r flag tells du to display an error message
if it cannot read a file or directory.
RELATED INFORMATION
See the following commands: "df" and "quot."
Processed November 8, 1990 DU(1,C) 2