du command
Show how much disk space files and directories use.
- Disks & storage
- Package coreutils
- 6 options · 5 examples
Syntax
du [options] [path…]Provided by the coreutils package. Run man du for the full manual.
Common options
| Option | What it does |
|---|---|
-h | Human-readable sizes |
-s | One total per argument |
-c | Add a grand total |
-a | Include files, not just directories |
--max-depth=N | Limit the depth (-d N) |
--exclude=PATTERN | Skip matching files |
Examples
Size of a directory
du -sh /var/logSize of each item here
du -sh *Largest directories first
du -h --max-depth=1 / 2>/dev/null | sort -rh | headTop 10 largest items
du -ah /var | sort -rh | head -n 10Exclude a pattern
du -sh --exclude="*.iso" ~/Downloads
No example matches. Check the options table or search the guides.
du guides
- How to sort du -h command output by size Linux Commands · Updated Apr 2025
- du command in Linux with Useful Examples Linux Commands · Updated Apr 2025
