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
| Flag | Description |
|---|---|
| -h | Human-readable sizes |
| -s | Show only total for each argument |
| -d | Max depth |
| -a | Show all files, not just directories |
| --exclude | Exclude pattern |
| -c | Produce 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