← Linux command list

df command: check how much disk space is left

__ __ _ _____
\ \ / /__| |_|_ _|__ _ __ _ __ ___
\ \ /\ / / _ \ '_ \| |/ _ \ '__| '_ ` _ \
\ V V / __/ |_) | | __/ | | | | | |
\_/\_/ \___|_.__/|_|\___|_| |_| |_| |_
 
A sandbox for trying df. Nothing here can touch your real files.
 

df shows how much space each filesystem has left. Learn how to read `-h` output, how `df -h .` names the filesystem you are writing to, and why `df -i` explains a full disk with space on it, by running the commands in a real terminal in your browser.

Updated: 2026-11-21

Syntax

df [options] [path]

With no path it lists every filesystem on the machine.

Try it first

-h prints readable sizes.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           795M  1.1M  794M   1% /run
/dev/sda1        19G  5.0G   14G  27% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   61M  758M   8% /boot
/dev/sda15      105M  6.1M   99M   6% /boot/efi
tmpfs           795M   12K  795M   1% /run/user/1000

Each line is one filesystem.

ColumnMeaning
FilesystemThe device
SizeTotal size
UsedIn use
AvailStill free
Use%Percentage used
Mounted onWhere that device appears in the tree

The two columns worth reading are Use% and Mounted on. A row near 100% tells you which path is full.

Asking about a path

Given a path, df prints only the filesystem holding it.

$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        19G  5.0G   14G  27% /

You do not have to know the mount point. Hand it the directory you are writing to and it names the filesystem in charge.

$ df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda16      881M   61M  758M   8% /boot

Small partitions such as /boot are the ones that quietly fill up.

Space left, writes failing

A filesystem also limits how many files it can hold. Those slots are inodes, and -i reports them.

$ df -i
Filesystem      Inodes  IUsed   IFree IUse% Mounted on
tmpfs          1017347    812 1016535    1% /run
/dev/sda1      2433024 100000 2333024    5% /
tmpfs          1017347      1 1017346    1% /dev/shm
tmpfs          1017347      3 1017344    1% /run/lock
/dev/sda16       65536    351   65185    1% /boot
/dev/sda15           0      0       0     - /boot/efi
tmpfs           203468     26  203442    1% /run/user/1000

When Use% looks fine but writes fail, read IUse% instead. Session files and caches that create huge numbers of tiny files run out of inodes first.

When you actually reach for it

df is the first command to type when something says it is out of space.

SituationWhat to type
Find what is fulldf -h
Check the place you are writing todf -h .
Look at the log partitiondf -h /var/log
Space left but writes failingdf -i
Hunt down the culprit once you know wheredu -h --max-depth=1

Locate with df, dig with du. That order handles most disk incidents.

Things that trip people up

Without -h the numbers are blocks.

$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
tmpfs             813876    1056    812820   1% /run
/dev/sda1       19455308 5233664  14221644  27% /
tmpfs            4069388       0   4069388   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
/dev/sda16        901792   62196    776052   8% /boot
/dev/sda15        106832    6186    100646   6% /boot/efi
tmpfs             813872      12    813860   1% /run/user/1000

Readable for a script, hard work for a person, so add -h when you are the one reading.

A path has to exist.

$ df -h /nope
df: '/nope': No such file or directory

Deleting a file does not always free the space. While a process still holds the file open, the space stays taken. When df refuses to drop, look for the process holding it.

Practise it hands-on

webterm.app

  • Advanced Terminal Commands

    Learn commands for specific situations

    Try the tutorial

learn.webterm.app

>_WEBTERM LEARN

WebTerm Learn: from one command to actually using it

Commands stick when they show up in a real sequence of work, not one at a time. There is a course that builds them up in order.

See the course

Related commands

du / ls / rm

df is also in the “Check the system” section of the Linux Commands Cheat Sheet.

Frequently asked questions

What is the difference between df and du?
`df` shows how much room the machine has left, `du` shows which directory is using it. Find the full filesystem with `df`, then go to that place and run `du`.
Use% says 100%. What now?
Go to the path in the Mounted on column and run `du -h --max-depth=1`. That tells you which directory is holding the space, and from there you can decide what to delete.
There is space left but writes still fail.
You may be out of inodes. Run `df -i` and check whether IUse% has hit 100%. Enough small files will exhaust inodes long before the bytes run out.
How do I tell which disk I am writing to?
`df -h .`. Given a path, df prints only the filesystem that holds it.
What are the tmpfs rows?
Filesystems that live in memory, used for `/run` and `/dev/shm`. Their contents disappear on reboot.