du

Disk usage: estimate and summarize file and directory space usage. More information: <https://www.gnu.org/software/coreutils/du>.

Install

All systems
curl cmd.cat/du.sh
Debian Debian
apt-get install coreutils
Ubuntu
apt-get install coreutils
Alpine
apk add coreutils
Arch Arch Linux
pacman -S coreutils
image/svg+xml Kali Linux
apt-get install coreutils
CentOS
yum install coreutils
Fedora
dnf install coreutils
Windows (WSL2)
sudo apt-get update sudo apt-get install coreutils
OS X
brew install coreutils
Raspbian
apt-get install coreutils
Docker
docker run cmd.cat/du du powered by Commando

Disk usage: estimate and summarize file and directory space usage. More information: <https://www.gnu.org/software/coreutils/du>.

  • List the sizes of a directory and any subdirectories, in the given unit (B/KiB/MiB):
    du -b|k|m path/to/directory
  • List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
    du -h path/to/directory
  • Show the size of a single directory, in human-readable units:
    du -sh path/to/directory
  • List the human-readable sizes of a directory and of all the files and directories within it:
    du -ah path/to/directory
  • List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
    du -h --max-depth=N path/to/directory
  • List the human-readable size of all `.jpg` files in subdirectories of the current directory, and show a cumulative total at the end:
    du -ch */*.jpg

© tl;dr; authors and contributors