df Command: Check Disk Usage with -h, -T, and -i Options
The df command is a Linux command that prints the total size, used space, available space, and usage rate of each mounted file system, one line per file system. Running df with the -h, -T, -i, --output, and -x options one at a time on an AlmaLinux 9 server and a Debian 12 server and comparing the output showed that disk space is checked in the Use% column, and the file count limit separately in the IUse% column of df -i.
In the AlmaLinux 9.8 server output, the device names, disk sizes, and the tmpfs sizes and usage that depend on memory size were replaced with consistent example values, and mount lines that exist only on that server were removed. The folder path written in the commands is also an example value, and the Debian 12 server output is shown as it was.
1️⃣ How to Use the Linux df Command
The basic form is [df options file]. Without a file, it prints every mounted file system, and without options it shows sizes as a number of 1,024-byte blocks.
dfFilesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1890316 0 1890316 0% /dev
tmpfs 1921072 0 1921072 0% /dev/shm
tmpfs 768432 17104 751328 3% /run
efivarfs 128 4 120 4% /sys/firmware/efi/efivars
/dev/sda4 52403180 10265000 42138180 20% /
/dev/sda3 983040 319488 663552 33% /boot
/dev/sda2 204580 7116 197464 4% /boot/efi
tmpfs 384212 4 384208 1% /run/user/0The output has six columns, and each column holds what the table below shows.
| Field | Contents |
|---|---|
| Filesystem | Device name or file system name (tmpfs, etc.) |
| 1K-blocks | Total size (number of 1,024-byte blocks) · Size with -h |
| Used | Used size |
| Available | Available size · Avail with -h |
| Use% | Usage rate · Used ÷ (Used + Available), rounded up |
| Mounted on | Mount point (the folder the file system is attached to) |
Attaching a device to a folder is called disk mounting, and to attach it automatically at every boot, you add it to /etc/fstab.
Calculating each line of the AlmaLinux 9.8 server output showed that Use% equals Used divided by the sum of Used and Available, rounded up. For the root (/) in the output above, 10265000 divided by 52403180 is 19.6%, which was shown as 20%.
df is part of the coreutils package. The version was checked from the first line of [df --version]: coreutils 8.32 on the AlmaLinux 9.8 server and 9.1 on the Debian 12 server.
df --version | head -n 1df (GNU coreutils) 8.32df --version | head -n 1df (GNU coreutils) 9.12️⃣ df -h Option
-h groups sizes in units of 1,024 and prints them with K, M, or G.
df -hFilesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 751M 17M 734M 3% /run
efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 50G 9.8G 41G 20% /
/dev/sda3 960M 312M 648M 33% /boot
/dev/sda2 200M 7.0M 193M 4% /boot/efi
tmpfs 376M 4.0K 376M 1% /run/user/0The root (/) 1K blocks of 52403180 became 50G, and the used 10265000 became 9.8G. The numbers are rounded up; values under 10 showed one decimal place like 9.8G, and values of 10 or more showed as integers like 50G.
-H groups sizes in units of 1,000 instead of 1,024.
df -HFilesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 787M 18M 770M 3% /run
efivarfs 132k 3.9k 123k 4% /sys/firmware/efi/efivars
/dev/sda4 54G 11G 44G 20% /
/dev/sda3 1.1G 328M 680M 33% /boot
/dev/sda2 210M 7.3M 203M 4% /boot/efi
tmpfs 394M 4.1k 394M 1% /run/user/0The same root showed as 54G with -H, a larger number than with -h, and the kilo unit changed to a lowercase k, as in 132k.
If you give a file or folder, df prints only the one line for the file system that contains that path.
df -h /root/workFilesystem Size Used Avail Use% Mounted on
/dev/sda4 50G 9.8G 41G 20% //root/work is a folder inside the root (/), so the /dev/sda4 line appeared. The space each folder takes up is totaled with the du command.
On the Debian 12 server, giving the home folder (~) from a regular account printed a single /dev/vda2 line with a usage rate of 52%.
df -h ~Filesystem Size Used Avail Use% Mounted on
/dev/vda2 23G 12G 11G 52% /3️⃣ df -T File System Type
-T adds a Type column after Filesystem and prints the file system type.
df -hTFilesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 751M 17M 734M 3% /run
efivarfs efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 xfs 50G 9.8G 41G 20% /
/dev/sda3 xfs 960M 312M 648M 33% /boot
/dev/sda2 vfat 200M 7.0M 193M 4% /boot/efi
tmpfs tmpfs 376M 4.0K 376M 1% /run/user/0The disk partitions /dev/sda4 and /dev/sda3 were xfs, and /boot/efi was vfat. tmpfs and devtmpfs are file systems that use memory instead of disk.
The root of the Debian 12 server was ext4.
df -hT ~Filesystem Type Size Used Avail Use% Mounted on
/dev/vda2 ext4 23G 12G 11G 52% /-t keeps only the given type, and -x prints everything except the given type.
df -t xfs -hFilesystem Size Used Avail Use% Mounted on
/dev/sda4 50G 9.8G 41G 20% /
/dev/sda3 960M 312M 648M 33% /bootRunning with -t xfs left only the two xfs lines.
df -x tmpfs -hFilesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 50G 9.8G 41G 20% /
/dev/sda3 960M 312M 648M 33% /boot
/dev/sda2 200M 7.0M 193M 4% /boot/efi-x tmpfs removed the three tmpfs lines, while devtmpfs, which has a similar name, stayed. Only lines whose type name matches exactly are removed, so to remove devtmpfs as well, write -x once more.
df -x tmpfs -x devtmpfs -hFilesystem Size Used Avail Use% Mounted on
efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 50G 9.8G 41G 20% /
/dev/sda3 960M 312M 648M 33% /boot
/dev/sda2 200M 7.0M 193M 4% /boot/efi4️⃣ df -i Inode Usage
inode is management data, one of which is used for each file and folder. -i prints inode counts instead of sizes.
df -iFilesystem Inodes IUsed IFree IUse% Mounted on
devtmpfs 472579 377 472202 1% /dev
tmpfs 480268 2 480266 1% /dev/shm
tmpfs 819200 645 818555 1% /run
efivarfs 0 0 0 - /sys/firmware/efi/efivars
/dev/sda4 26201024 98214 26102810 1% /
/dev/sda3 524288 362 523926 1% /boot
/dev/sda2 0 0 0 - /boot/efi
tmpfs 96053 21 96032 1% /run/user/0Inodes is the total number that can be created, IUsed the number used, IFree the number left, and IUse% the usage rate. /boot/efi, which is vfat, and efivarfs have an inode count of 0, so IUse% showed as -.
Each new file uses one inode, so once IUse% reaches 100%, no new file can be created even if Use% is low. On a server that collects many small files, check [df -h] and [df -i] together.
Adding -h as well groups the counts in K and M units too, so the root's 26201024 showed as 25M.
df -ihFilesystem Inodes IUsed IFree IUse% Mounted on
devtmpfs 462K 377 462K 1% /dev
tmpfs 470K 2 470K 1% /dev/shm
tmpfs 800K 645 800K 1% /run
efivarfs 0 0 0 - /sys/firmware/efi/efivars
/dev/sda4 25M 96K 25M 1% /
/dev/sda3 512K 362 512K 1% /boot
/dev/sda2 0 0 0 - /boot/efi
tmpfs 94K 21 94K 1% /run/user/0The Debian 12 server was using 188009 of 6285088 inodes, for an IUse% of 3%.
df -i ~Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda2 6285088 188009 6097079 3% /5️⃣ df --output to Choose Output Columns
--output sets the columns to print and their order directly. Column names are joined with commas, and the twelve names in the table below can be used (per --help).
| Column name | Header | Contents |
|---|---|---|
| source | Filesystem | Device name / file system name |
| fstype | Type | File system type |
| itotal | Inodes | Total inode count |
| iused | IUsed | Used inode count |
| iavail | IFree | Available inode count |
| ipcent | IUse% | Inode usage rate |
| size | Size | Total size |
| used | Used | Used size |
| avail | Avail | Available size |
| pcent | Use% | Usage rate |
| file | File | File name given in the command |
| target | Mounted on | Mount point |
df --output=source,fstype,size,used,avail,pcent,target -hFilesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs tmpfs 751M 17M 734M 3% /run
efivarfs efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 xfs 50G 9.8G 41G 20% /
/dev/sda3 xfs 960M 312M 648M 33% /boot
/dev/sda2 vfat 200M 7.0M 193M 4% /boot/efi
tmpfs tmpfs 376M 4.0K 376M 1% /run/user/0Listing seven columns in order produced the same output as [df -hT].
df --output=target,pcent,avail -hMounted on Use% Avail
/dev 0% 1.9G
/dev/shm 0% 1.9G
/run 3% 734M
/sys/firmware/efi/efivars 4% 120K
/ 20% 41G
/boot 33% 648M
/boot/efi 4% 193M
/run/user/0 1% 376MWriting the column names in the order target, pcent, avail put the mount point first, followed by the usage rate and the available size in that order.
--total adds a total line at the bottom.
df -h --totalFilesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 751M 17M 734M 3% /run
efivarfs 128K 3.8K 120K 4% /sys/firmware/efi/efivars
/dev/sda4 50G 9.8G 41G 20% /
/dev/sda3 960M 312M 648M 33% /boot
/dev/sda2 200M 7.0M 193M 4% /boot/efi
tmpfs 376M 4.0K 376M 1% /run/user/0
total 56G 11G 46G 19% -The total line is the sum of all eight lines above, so file systems that use memory, such as tmpfs, were added in as well.
🔲 df Command Simulator
In the simulator below, you can run df with -h, -H, -T, -i, -t, -x, --output, and --total and see how the output columns change for each option.
6️⃣ df Command Errors
Giving a path that does not exist printed [No such file or directory] and ended with exit code 1.
df -h /nonexistent-dirdf: /nonexistent-dir: No such file or directoryGiving -t a type that is not on the server leaves no line to print, so [no file systems processed] appeared, and the exit code was 1.
df -t nosuchfsdf: no file systems processedGiving --output a column name that does not exist put that name in the error message.
df --output=bogusdf: option --output: field 'bogus' unknown
Try 'df --help' for more information.Using -i or -T together with --output printed [mutually exclusive] and ended with the same exit code 1. To see inodes or types with --output, write column names such as itotal and fstype.
df -i --outputdf: options -i and --output are mutually exclusive
Try 'df --help' for more information.🔢 FAQ & Recommended Content
UUID
Linux blkid Command | UUID vs GUID
An article on checking the file system type and UUID of block devices with the blkid command.
Partition
gdisk Command: How to Partition a Disk in Linux
An article on the steps for creating and deleting partitions on a disk with the gdisk command.
ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.