Updated 25 October 2026 · Published by Zoorik
df vs du is the comparison of two Linux commands that report disk space. The difference between du and df in Linux is where each one looks:
dfshows what a whole file system has used and has left.duadds up the space your files take, folder by folder.ducan’t see a file that no folder lists, such as a deleted file that’s still open.
df -h /data du -shx /data
Use -h for sizes such as 20G, -s for one total, and -x to stay on one file system.
An example: df and du showing different results
Say a 100 GiB disk is mounted at /data (an illustration). Then df -h says 50G used, but du says only 30G.
The missing 20 GiB is a deleted log file. An app still has it open, and Linux keeps a deleted file until the last process using it closes it. So df counts it, and du can’t.
Restart the app, and df drops by 20 GiB.
Why it matters for your bill
- AWS bills Amazon Elastic Block Store (EBS) volumes by the GB you provision per month.
- On EBS, the example disk bills 100 GiB for 30 GiB of files.
- If
dfsays a disk is full, check the df and du difference before you pay for a bigger one.
For a cloud virtual machine (VM), see how to check Azure VM disks and EBS volumes.
Amoeba moves a VM’s data disks onto one pool sized to your data, then rightsizes it autonomously. The free assessment works out your own figure.
Read next: Azure VM disk usage: check used vs provisioned
Sources: man7.org, “df(1): Linux manual page” (opens in a new tab); man7.org, “du(1): Linux manual page” (opens in a new tab); man7.org, “unlink(2): Linux manual page” (opens in a new tab); AWS, “Amazon EBS pricing” (opens in a new tab).