df: show free disk space

Updated November 2026

df shows how much space is used and free on each mounted file system. It is the first thing to run when something complains that the disk is full.

df [options] [file or mount point ...]

Examples

df -h                     # every file system, human-readable
df -h /var                # the file system that holds /var
df -hT                    # include the file system type (GNU)
df -h -x tmpfs -x devtmpfs -x overlay   # hide memory and container file systems (GNU)
df -i                     # inodes instead of blocks
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  233G  187G   34G  85% /
/dev/nvme0n1p1  511M  6.1M  505M   2% /boot/efi
/dev/sdb1       3.6T  2.9T  540G  85% /srv/backup

Size minus Used may be more than Avail: ext4 keeps about 5% reserved for root so the system can still work when users fill the disk.

Out of inodes

A file system can be "full" with gigabytes free if it has run out of inodes, the slots that describe files. This happens with millions of tiny files, such as cache or session files. df -i shows it; find the directory with the most files with:

sudo du --inodes -x -d 2 / | sort -n | tail     # GNU du

When a disk is full

  1. Find the big directories with du.
  2. Clean safe things first: package caches (sudo apt clean, sudo dnf clean all), old journal logs (sudo journalctl --rotate --vacuum-size=500M), stopped containers, dangling images and build cache (docker system prune or podman system prune; add -a to also remove all unused images).
  3. Compress or remove old logs, and check that log rotation works.
  4. Check for deleted files held open: sudo lsof +L1.
  5. If the data is legitimate, grow the file system (LVM, VxVM, ZFS, or a bigger cloud disk) rather than deleting.

Other systems

On AIX, df -g shows sizes in gigabytes; on HP-UX, use bdf; on Solaris and illumos, df -h works and zfs list gives a better picture for ZFS pools. macOS supports df -h.