Cheatsheet: du
Last updated 2026-06-21
Basic usage
Show disk usage for directories below the current directory in block-size units.
Show sizes in human-readable units such as K, M, and G.
Summarize the total size of one directory.
Summarize each item directly inside a directory.
Show a grand total after listing individual arguments.
Depth and scope
Limit output to the current directory and one level of children.
GNU equivalent for limiting output depth.
Show apparent file size instead of allocated disk blocks, useful for sparse files.
Stay on one filesystem and do not cross mounted filesystems.
Count hard-linked files every time they are encountered instead of once.
Finding large items
Sort files and directories by size, smallest first.
Sort by size, largest first.
Sort human-readable sizes, largest first.
Show the ten largest items in the current directory.
Show only entries at or above a threshold size with GNU du.
Show entries at or below a threshold size with GNU du.
Excluding paths
Exclude a directory name pattern such as node_modules.
Exclude multiple glob patterns using repeated --exclude options.
Read exclude patterns from a file with GNU du.
See also: