System Info

du

Estimate file and directory disk space usage.

Synopsis

syntax
du [OPTION]... [FILE]...

Examples

Size of each item in current directory
du -sh *
Total size of /var/log
du -sh /var/log
Size of each subdirectory in /home
du -h -d 1 /home
Total size excluding log files
du -sh --exclude='*.log' /var

Common options

FlagDescription
-hHuman-readable sizes
-sShow only total for each argument
-dMax depth
-aShow all files, not just directories
--excludeExclude pattern
-cProduce grand total

About du

The `du` command estimate file and directory disk space usage. System information commands provide insight into hardware, kernel, memory, disk, and user session details.

These are typically the first tools you reach for when diagnosing system problems, capacity planning, or auditing a server's configuration. They work across most Linux distributions without additional packages.

The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man du`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More System Info Commands

Other commands in the System Info category

Related tools