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.
user@webterm:~/project$
 

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-09-06

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
/dev/sda1        20G  5.0G   14G  27% /
/dev/sda2        40G   10G   28G  27% /home
/dev/sda3       1.0G  205M  819M  20% /boot
tmpfs           2.0G     0  2.0G   0% /tmp
tmpfs           800M  1.0M  799M   1% /run
devtmpfs        2.0G     0  2.0G   0% /dev

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/sda2        40G   10G   28G  27% /home

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/sda3       1.0G  205M  819M  20% /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
/dev/sda1      1310720 100000 1210720    8% /
/dev/sda2      2621440  50000 2571440    2% /home
/dev/sda3        65536    320  65216    0% /boot
tmpfs           524288     10 524278    0% /tmp
tmpfs           524288     50 524238    0% /run
devtmpfs        524288    300 523988    0% /dev

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
/dev/sda1        20971520    5242880   14680064  27% /
/dev/sda2        41943040   10485760   29360128  27% /home
/dev/sda3         1048576     209715     838861  20% /boot
tmpfs             2097152          0    2097152   0% /tmp
tmpfs              819200       1024     818176   1% /run
devtmpfs          2097152          0    2097152   0% /dev

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.appthis site

  • Advanced Terminal Commands

    Learn commands for specific situations

    Try the tutorial

learn.webterm.appa separate site

>_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

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 `/tmp` and `/run`. Their contents disappear on reboot.