System and processes

The du command

Measures how much a folder or file takes. The space detective.

Syntax

du [-sh] <ruta>

Most useful options

-sOnly the total, no breakdown
-hHuman-readable sizes
-aAlso includes files

Copy-ready examples

$ du -sh DocumentosHow much a folder takes
$ du -h --max-depth=1What each subfolder takes

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Without -s it lists every subfolder: useful to find the space culprit.

Related commands

FAQ

How do I find what fills my disk?

With du -h --max-depth=1 from the root of the affected area.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course