This tutorial explains how to show total disk space usage by an entire disk volume (also called a file system). This means that if two directories (for example, /var/log/nginx/
and /home/ubuntu/
are on the same disk volume, the output for the command described below will be the same).
To find out how much disk space a specific directory is using (the total size of all files and subdirectories in the directory), see this tutorial.
If you're using an Ubuntu laptop or desktop, you can press Ctrl + Alt + T
on your keyboard to open a new terminal window. If you're using a remote Ubuntu server, you can connect using SSH to open a new terminal session.
df
CommandTo check disk space usage for the root volume mounted at /
:
$ df -h /
The -h
option tells the command to show "human friendly" output (using familiar units like Gi for Gibibytes/Gigabytes and Mi for Mebibytes/Megabytes).
The /
tells df
to show disk usage for the volume where /
is located.
You should see output like:
Filesystem Size Used Avail Use% Mounted on /dev/root 59G 8.6G 50G 15% /
To show usage for all disk volumes on your system, you can leave out the /
path:
$ df -h
To show usage for disks for specific paths, just add them to the end of the command. For example:
$ df -h / /run
which should output:
Filesystem Size Used Avail Use% Mounted on /dev/root 59G 8.6G 50G 15% / tmpfs 199M 4.2M 195M 3% /run