df Command - Check Disk Capacity

You can check the disk capacity with the df command.

df

This is a sample output result. The capacity is displayed in 1 Kbyte units for each disk.

Filesystem      1K-blocks    Used  Available Use% Mounted on
udev              4044556       0    4044556   0% /dev
tmpfs              812572     736     811836   1% /run
/dev/sda1        30309264 4263080   26029800  15% /
tmpfs             4062840       8    4062832   1% /dev/shm
tmpfs                5120       0       5120   0% /run/lock
tmpfs             4062840       0    4062840   0% /sys/fs/cgroup
/dev/sda15         106858    3668     103190   4% /boot/efi
/dev/sdc1      1055838644   77852 1002057420   1% /datadrive
/dev/sdb1        16447292   45084   15547020   1% /mnt
tmpfs              812568       0     812568   0% /run/user/1001

"/ Dev / sda1", "/ dev / sda15", "/ dev / sdc1", and "/ dev / sdb1" are logical disks separated by partitions. The file system is mounted on this.

The disk capacity displayed by df is not for the physical disk, but for the partition (logical disk) set on the physical disk.

To display in an easy-to-understand manner with units

Use the "-h" option to clearly display the units of the df command.

df -h

The output result has a unit.

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           794M  736K  793M   1% /run
/dev/sda1        29G  4.1G   25G  15% /
tmpfs           3.9G  8.0K  3.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda15      105M  3.6M  101M   4% /boot/efi
/dev/sdc1      1007G   77M  956G   1% /datadrive
/dev/sdb1        16G   45M   15G   1% /mnt
tmpfs           794M     0  794M   0% /run/user/1001

How to check the capacity of the directory?

Use the du command to check the capacity of the directory.

Note that the df command is a command to check the disk capacity, and the du command is used to check the directory capacity.

Associated Information