Disk and Storage

du

Estimates file and directory space usage.

du walks files and sums disk usage. It helps find what is consuming space inside a filesystem.

Syntax
du [options] [path]

Arguments explained

  • path is the file or directory to measure.
  • -h uses human-readable sizes.
  • -s summarizes instead of listing everything.
  • -d limits directory depth on GNU systems.

Common examples

Summarize directories
du -h -d 1 /var 2>/dev/null

Shows first-level usage under /var while ignoring permission errors.

Measure one folder
du -sh ~/Downloads

Shows a single total for Downloads.

du Command
FieldDetails
Commanddu
CategoryDisk and Storage
Primary useEstimates file and directory space usage.
Syntaxdu [options] [path]