Skip to content

df

8 commands

Reports free and used disk space on mounted file systems.

  • disk
  • storage

Install df

sudo apt install coreutils

Basics8

df -h

Shows disk space for every mounted file system in human-readable units.

df -h <path>

Shows the file system that holds a path.

Link
df -hT

Adds the file-system type column (ext4, xfs, tmpfs…).

df -i

Shows inode usage. A disk can be “full” with free space if inodes run out.

df -x tmpfs -x devtmpfs -h

Hides virtual file systems so only real disks remain.

df -t <type> -h

Shows only one file-system type.

Link
df --output=source,pcent,target

Chooses which columns to print (GNU).

df -h | awk '$5+0 > 80'

Lists file systems more than 80% full.