How to check disk usage with du

Published 2025-10-20 14:24:39 UTC


How to check disk usage with du


The `du` command helps you estimate and summarize the disk space used by files and directories.


To view disk usage of a folder with human-readable sizes:

du -cha <DIRECTORY>

The -c flag adds a total at the end, -h makes sizes human-readable, and -a shows all files, not just directories.
You can combine it with sort -h to see which files or directories consume the most space:

du -cha <DIRECTORY> | sort -h