du
Options
--help
-
du-help-print-help
--all
,-a
-
du-help-all
--apparent-size
-
du-help-apparent-size
--block-size=<SIZE>
,-B <SIZE>
-
du-help-block-size
--bytes
,-b
-
du-help-bytes
--total
,-c
-
du-help-total
--max-depth=<N>
,-d <N>
-
du-help-max-depth
--human-readable
,-h
-
du-help-human-readable
--inodes
-
du-help-inodes
-k
-
du-help-block-size-1k
--count-links
,-l
-
du-help-count-links
--dereference
,-L
-
du-help-dereference
--dereference-args
,-D
,-H
-
du-help-dereference-args
--no-dereference
,-P
-
du-help-no-dereference
-m
-
du-help-block-size-1m
--null
,-0
-
du-help-null
--separate-dirs
,-S
-
du-help-separate-dirs
--summarize
,-s
-
du-help-summarize
--si
-
du-help-si
--one-file-system
,-x
-
du-help-one-file-system
--threshold=<SIZE>
,-t <SIZE>
-
du-help-threshold
--verbose
,-v
-
du-help-verbose
--exclude=<PATTERN>
-
du-help-exclude
--exclude-from=<FILE>
,-X <FILE>
-
du-help-exclude-from
--files0-from=<FILE>
-
du-help-files0-from
--time=<WORD>
-
du-help-time
--time-style=<STYLE>
-
du-help-time-style
Examples
List the sizes of a directory and any subdirectories, in the given unit (B/KiB/MiB):
du -{{b|k|m}} {{path/to/directory}}
List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
du {{[-h|--human-readable]}} {{path/to/directory}}
Show the size of a single directory, in human-readable units:
du {{[-sh|--summarize --human-readable]}} {{path/to/directory}}
List the human-readable sizes of a directory and of all the files and directories within it:
du {{[-ah|--all --human-readable]}} {{path/to/directory}}
List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
du {{[-h|--human-readable]}} {{[-d|--max-depth]}} N {{path/to/directory}}
List the human-readable size of all .jpg
files in current directory, and show a cumulative total at the end:
du {{[-ch|--total --human-readable]}} {{./*.jpg}}
List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space):
du {{[-ah|--all --human-readable]}} {{[-t|--threshold]}} {{1G|1024M|1048576K}} .[^.]* *
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.