Rain WikiWindows · Linux · Android

df (disk free)

Command-line toolAll Linux distributions

df (disk free) is the standard command that shows the size, used space, available space and mount point of each mounted file system. df -h prints sizes in human-readable units; df -i shows inode usage instead of bytes, which explains 'No space left on device' errors when bytes are still free.

1Reading the columns

Filesystem is the device, Size the total, Used and Avail the space used and free for normal users, Use% the percentage, and Mounted on the directory where it appears.

On ext4, about 5% is reserved for root by default, so Used + Avail can be smaller than Size and normal users can run out before Use% shows 100%.

2Useful options

-T adds the file system type, -x tmpfs hides temporary memory file systems, and df -h /var shows only the file system that holds /var.

How to check free space

  1. Run: df -hT -x tmpfs
  2. Find the file system with high Use%.
  3. Check inodes too: df -i
  4. Then look inside with du or ncdu to find what uses the space.

Cautions

  • Never fill the root file system to 100%: services, logins and package updates can fail.

Sources

  1. df(1) man7.org
  2. inode(7) man7.org

Note: RainServer offers monitoring and safe cleanup for Linux servers; it shows what will change and asks first.

Last reviewed: