du: Estimate file space usage
du reports the amount of disk space used by the specified files
and for each subdirectory (of directory arguments). Synopsis:
With no arguments,
du reports the disk space for the current
directory. Normally the disk space is printed in units of
1024 bytes, but this can be overridden (see section 2.2 Block size).
Non-integer quantities are rounded up to the next higher unit.
The program accepts the following options. Also see 2. Common options.
Show counts for all files, not just directories.
Print sizes in bytes, overriding the default block size (see section 2.2 Block size).
- `-B size'
Scale sizes by size before printing them (see section 2.2 Block size).
For example, `-BG' prints sizes in units of 1,073,741,824 bytes.
Print a grand total of all arguments after all arguments have
been processed. This can be used to find out the total disk usage of
a given set of files or directories.
Dereference symbolic links that are command line arguments.
Does not affect other symbolic links. This is helpful for finding
out the disk usage of directories, such as `/usr/tmp', which
are often symbolic links.
Append a size letter to each size, such as `M' for mebibytes.
Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes.
Use the `-H' or `--si' option if you prefer powers of 1000.
Append an SI-style abbreviation to each size, such as `MB' for
megabytes. Powers of 1000 are used, not 1024; `MB' stands for
1,000,000 bytes. Use the `-h' or `--human-readable' option if
you prefer powers of 1024.
Print sizes in 1024-byte blocks, overriding the default block size
(see section 2.2 Block size).
This option is equivalent to `--block-size=1K'.
Count the size of all files, even if they have appeared already (as a
Dereference symbolic links (show the disk space used by the file
or directory that the link points to instead of the space used by
Show the total for each directory (and file if --all) that is at
most MAX_DEPTH levels down from the root of the hierarchy. The root
is at level 0, so
du --max-depth=0 is equivalent to
Display only a total for each argument.
Report the size of each directory separately, not including the sizes
Skip directories that are on different filesystems from the one that
the argument being processed is on.
When recursing, skip subdirectories or files matching PATTERN.
du --exclude='*.o' excludes files whose names
end in `.o'.
- `-X FILE'
Like `--exclude', except take the patterns to exclude from FILE,
one per line. If FILE is `-', take the patterns from standard
On BSD systems,
du reports sizes that are half the correct
values for files that are NFS-mounted from HP-UX systems. On HP-UX
systems, it reports sizes that are twice the correct values for
files that are NFS-mounted from BSD systems. This is due to a flaw
in HP-UX; it also affects the HP-UX