du - summarize disk usage
du [-arklmsxLR] [name ...]
The du command reports the number of blocks contained in all files and
(recursively) directories within each directory and file specified by the
name arguments. If no name arguments are given, the current directory is
By default, the block counts reported are in terms of 512-byte blocks,
but this can be modified to 1024-byte blocks by specifying the -k option
(see below). The block count includes only the actual data blocks used
by each file and directory, not indirect blocks or other filesystem data
structures required to represent the file. du keeps track of files that
have more than one name (hard link) and counts the blocks used by the
file only the first time it finds a link to the file.
The optional arguments are as follows:
-a Causes an output line to be generated for each file. If neither -s
nor -a is specified, an output line is generated only for each
-r Causes du to generate messages about directories that cannot be read
and files that cannot be opened. (This option is on by default. The
-R option can be used to suppress these messages.)
-k Causes du to express all block counts in terms of 1024-byte blocks,
instead of the default 512-byte blocks. The internal accounting is
still done in terms of 512-byte blocks, because that is the actual
filesystem allocation granularity. The numbers are converted to
1024-byte blocks before being printed. This means that the total
block count shown for a directory is less than the sum of the block
counts of the contained files and directories when more than one of
the contained files is less than 512 bytes in size.
-l Prevent du from descending into and computing disk usage for
directories and files that do not reside on local disk filesystems.
-m Prevents du from descending into and computing disk usage for
directories and files that do not reside on the same mount point as
the current root of the recursion.
-s Causes only the grand total (for each of the specified name
arguments) to be given. If neither -s or -a is specified, an output
line is generated for each directory only.
-x Identical to the -m option.
-L Causes du to follow symbolic links. The default behavior is not to
follow symbolic links, so that du normally reports the size of the
symbolic link itself. When -L is specified, du reports the size of
the target of the symbolic link. If the symbolic link points to a
directory when -L is specified, du recursively descends the
directory just as it does for normal directories.
-R Suppresses messages about directories that cannot be read and files
that cannot be opened.
language-specific message file (see LANG in environ(5))
If the -a option is not used, nondirectories given as arguments are not
When using the -l option, nonlocal directories and files given as
arguments are not listed.
Block count reporting for NFS versions 2 and 3 may not correspond to
block counts done on the local file systems on the NFS server. This is
because NFS calculates the block count based on the file size.
PPPPaaaaggggeeee 2222 [ Back ]