LearnGlossary

df vs du: meaning and cost impact

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:

  • df shows what a whole file system has used and has left.
  • du adds up the space your files take, folder by folder.
  • du can’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.

df counts a 20 GiB deleted file that du can't see Illustration. One bar for a 100 GiB data disk mounted at /data. From the left: 30 GiB filled and labelled Files in folders, then 20 GiB hatched and labelled Deleted, still open, then an amber 50 GiB span labelled Unused. Three brackets start at the left edge. The lowest, over the files only, reads du total: 30G. The middle one, over the files and the deleted file, reads df Used: 50G. The top one, over the whole bar, reads Billed: 100 GiB provisioned. df counts a 20 GiB deleted file that du can't see Billed: 100 GiB provisioneddf Used: 50Gdu total: 30GData disk/dataFiles in folders30 GiBDeleted, still open20 GiBUnused50 GiB
Illustration: a 100 GiB data disk at /data holding 30 GiB of files and one 20 GiB deleted log file that an app still holds open.

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 df says 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.

Find your own number

One line in your cloud console. One PDF report with your estimated saving at list price.

Estimate your saving

Talk to the builders

Thirty minutes with the people who build Amoeba.

Book a demo (opens in a new tab)

Or write to founders@zoorik.com