Skip to content

du command

Show how much disk space files and directories use.

On this page

Syntax

du [options] [path…]

Provided by the coreutils package. Run man du for the full manual.

Common options

OptionWhat it does
-hHuman-readable sizes
-sOne total per argument
-cAdd a grand total
-aInclude files, not just directories
--max-depth=NLimit the depth (-d N)
--exclude=PATTERNSkip matching files

Examples

  1. Size of a directory

    du -sh /var/log
  2. Size of each item here

    du -sh *
  3. Largest directories first

    du -h --max-depth=1 / 2>/dev/null | sort -rh | head
  4. Top 10 largest items

    du -ah /var | sort -rh | head -n 10
  5. Exclude a pattern

    du -sh --exclude="*.iso" ~/Downloads

du guides

← All Linux commands · Suggest a fix

Back to top