du
PURPOSE
Summarizes disk usage.
SYNOPSIS
du [ -arsl ] [ names ]
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
du report the number of blocks in individual files. The
block count includes the indirect blocks of each file and
is in units of 512 bytes, independent of the cluster size
used by the system. If you provide no file or directory
name, du uses the current directory.
Notes:
1. If you do not specify the -a flag, du does not report
on any files.
2. If there are too many distinct linked files, du
counts the excess files more than once.
3. Block counts are based only on file size; therefore,
unallocated blocks are not accounted for in the block
counts reported.
FLAGS
-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 speci-
fied 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
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 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 direc-
tory 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 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.