What does du do?

estimate file and directory disk usage.

▸ Explain your own du command →

du examples, explained

$ du -sh dir

  • duestimate file and directory disk usage
  • -sshow only a total for each argument
  • -hhuman-readable sizes (K, M, G)
  • diran argument passed to the command

$ du -ah .

  • duestimate file and directory disk usage
  • -ashow sizes for files too, not just directories
  • -hhuman-readable sizes (K, M, G)
  • .an argument passed to the command

du flags & options

-hhuman-readable sizes (K, M, G)
-sshow only a total for each argument
-ashow sizes for files too, not just directories
-calso print a grand total
-max-depthonly report directories this many levels deep

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.