NAME
du — summarize disk usage
SYNOPSIS
du
[-a|-s]
[-bkrx]
[-H|-L]
[-t
type]
[name]...
DESCRIPTION
The
du
command gives the number of 512-byte blocks allocated
for all files and (recursively) directories
within each directory and file specified by the
name
operands.
The block count includes the indirect blocks of the file.
A file with two or more links is counted only once.
If
name
is missing,
the current working directory is used.
By default,
du
generates an entry only for the
name
operands and each directory
contained within those hierarchies.
By default, when a symbolic link is encountered on the
command line or in the file hierarchy,
du
will count the size of the symbolic link rather than
the file referenced by the link, and will not follow
the link to another portion of the file hierarchy.
Options
The
du
command recognizes the following options:
- -a
Print entries for each file encountered
in the directory hierarchies
in addition to the normal output.
- -b
For each
name
operand that is a directory
for which file system swap has been enabled,
print the number of blocks the swap system is currently using.
- -H
If a symbolic link is specified on the command line,
du
will count the size of the file or file hierarchy referenced
by the link.
Unlike the
-L
option, it will not follow symbolic links encountered during the traversal
of the directory hierarchy.
- -k
Gives the block count in 1024-byte blocks.
- -L
If a symbolic link is specified on the command line or
encountered during the traversal of a file hierarchy,
du
will count the size of the file or file hierarchy referenced
by the link.
- -r
Print messages about directories that cannot be read,
files that cannot be accessed, and so on.
du
is normally silent about such conditions.
- -s
Print only the grand total of disk usage
for each of the specified
name
operands.
- -t type
Restrict reporting to file systems of the specified
type.
(Example values for
type
are
hfs,
cdfs,
nfs,
and so on.)
Multiple
-t type
options can be specified.
Disk usage is normally reported
for the entire directory hierarchy below each of the given
name
operands.
- -x
Restrict reporting to only those files
that have the same device as the file specified by the
name
operand.
Disk usage is normally reported
for the entire directory hierarchy below each of the given
name
operands.
According to the standards, specifying more than one of the
mutually-exclusive options
-H
and
-L
will not be considered an error.
The last option specified
will determine the behavior of the utility.
EXAMPLES
Display disk usage for the current working directory
and all directories below it,
generating error messages for unreadable directories:
Display disk usage for the entire file system except for any
cdfs
or
nfs
mounted file systems:
Display disk usage for files on the root volume
(/)
only.
No usage statistics are collected for any other mounted file systems:
WARNINGS
Block counts are incorrect for files that contain holes.
STANDARDS CONFORMANCE
du: SVID2, SVID3, XPG2, XPG3, XPG4