How To Install Du?

How To Install Du?

du

Disk usage: estimate and summarize file and folder space usage.

Maintainer: Michael Stone



Section: utils

Install du

  • Debian apt-get install coreutils Click to copy
  • Ubuntu apt-get install coreutils Click to copy
  • Alpine OS apk add coreutils Click to copy
  • Arch Linux pacman -S coreutils Click to copy
  • Kali Linux apt-get install coreutils Click to copy
  • CentOS yum install coreutils Click to copy
  • Fedora dnf install coreutils Click to copy
  • Raspbian apt-get install coreutils Click to copy
  • macOS brew install coreutils Click to copy

Disk usage: estimate and summarize file and folder space usage.

How to use du?

Below are few example commands for du that you can use in the terminal.

List the sizes of a folder and any subfolders, in the given unit (B/KB/MB):
du -b|k|m path/to/folderClick to copy
List the sizes of a folder and any subfolders, in human-readable form (i.e. auto-selecting the appropriate unit for each size):
du -h path/to/folderClick to copy
Show the size of a single folder, in human readable units:
du -sh path/to/folderClick to copy
List the human-readable sizes of a folder and of all the files and folders within it:
du -ah path/to/folderClick to copy
List the human-readable sizes of a folder and any subfolders, up to N levels deep:
du -h --max-depth=N path/to/folderClick to copy
List the human-readable size of all .jpg files in subfolders of the current folder, and show a cumulative total at the end:
du -ch */*.jpgClick to copy
Installing du command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS operating systems. Once you run the command it will install the latest version of du 2026 package in your OS.