df Command: Check Disk Usage with -h, -T, and -i Options

Test environmentRHEL familyAlmaLinux 9.8coreutils 8.32root accountDebian 12 · coreutils 9.1 regular accountChecked 2026-10-29
Disk · mount commandsdfLocation/usr/bin/df

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

  • ↪️ Six output columns and the Use% calculation

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.

df
Filesystem     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/0

The output has six columns, and each column holds what the table below shows.

FieldContents
FilesystemDevice name or file system name (tmpfs, etc.)
1K-blocksTotal size (number of 1,024-byte blocks) · Size with -h
UsedUsed size
AvailableAvailable size · Avail with -h
Use%Usage rate · Used ÷ (Used + Available), rounded up
Mounted onMount 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 1
df (GNU coreutils) 8.32
df --version | head -n 1
df (GNU coreutils) 9.1

2️⃣ df -h Option

  • ↪️ Readable units and a single path

-h groups sizes in units of 1,024 and prints them with K, M, or G.

df -h
Filesystem      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

The 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 -H
Filesystem      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/0

The 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/work
Filesystem      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

  • ↪️ Choosing types with -t and -x

-T adds a Type column after Filesystem and prints the file system type.

df -hT
Filesystem     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/0

The 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 -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda4        50G  9.8G   41G  20% /
/dev/sda3       960M  312M  648M  33% /boot

Running with -t xfs left only the two xfs lines.

df -x tmpfs -h
Filesystem      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 -h
Filesystem      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/efi

4️⃣ df -i Inode Usage

  • ↪️ Checking the file count limit

inode is management data, one of which is used for each file and folder. -i prints inode counts instead of sizes.

df -i
Filesystem       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/0

Inodes 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 -ih
Filesystem     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/0

The 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

  • ↪️ Choosing only the columns you need and the --total sum

--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 nameHeaderContents
sourceFilesystemDevice name / file system name
fstypeTypeFile system type
itotalInodesTotal inode count
iusedIUsedUsed inode count
iavailIFreeAvailable inode count
ipcentIUse%Inode usage rate
sizeSizeTotal size
usedUsedUsed size
availAvailAvailable size
pcentUse%Usage rate
fileFileFile name given in the command
targetMounted onMount point
df --output=source,fstype,size,used,avail,pcent,target -h
Filesystem     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/0

Listing seven columns in order produced the same output as [df -hT].

df --output=target,pcent,avail -h
Mounted 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%  376M

Writing 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 --total
Filesystem      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.

df Command Simulatorcoreutils 8.32
[root@server work]#
This is a virtual server that runs only inside your browser. Device names and sizes are example values, and the left panel shows the df -h size and usage rate for each mount point.

6️⃣ df Command Errors

  • ↪️ No such file or directory and no file systems processed

Giving a path that does not exist printed [No such file or directory] and ended with exit code 1.

df -h /nonexistent-dir
df: /nonexistent-dir: No such file or directory

Giving -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 nosuchfs
df: no file systems processed

Giving --output a column name that does not exist put that name in the error message.

df --output=bogus
df: 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 --output
df: options -i and --output are mutually exclusive
Try 'df --help' for more information.

🔢 FAQ & Recommended Content

Running [df -a] added lines for virtual file systems with a size of 0, such as proc, sysfs, and cgroup2, and the Use% column of these lines was -. The default output leaves these lines out (per --help).

Adding -l (--local) prints only local file systems (per --help). On the AlmaLinux 9.8 server, which has no remote mounts, [df -l -h] produced the same output as [df -h].

Giving -B a unit sets every size to that unit. Running [df -BM /] changed the header to 1M-blocks and showed the root size as 51175M.

ℹ️ 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove your humanity: 2   +   5   =