Beginner Package: coreutils

du

Estimate file and directory space usage.

Syntax

du [options] [path]

Description

du reports how much disk space files and directories actually consume, which is the standard way to find out what is filling up a disk — usually paired with sort to find the largest items first.

Examples

du -sh /var/log
Show the total size of a directory, human-readable
du -h --max-depth=1 /home
Show sizes one level deep, useful for finding large subdirectories
du -sh * | sort -rh | head
List the largest items in the current directory

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux

Put it into practice

Learn this in context