In this article ,we will show you how to use the DF command to check disk space in Linux and the DU commands to view file system disk space usage.
It is very important to manage your disk space on Linux server. For example, package management applications tell you how much disk space is required for installation. For this information to be meaningful, you must know how much space is available for your system.
What is DF command?
Disk Filesystem command gives a full brief of available space and the used space on all the file system on Linux system.
DF command to check file system disk space usage
DF command shows device name information , total blocks, total disk space, used disk space, available disk space and mount points on a file system.
Display disk space usage as human readable format
df command gives an option to show the size information in Human Readable format by passing ‘-h’ parameter (prints the results in human readable format (e.g., 1K 2M 3G 1T)).
Command to display information of one device like /home File System by DF command
Execute the following command if you want to display the information of one device (e.g. /home) file system in human readable format
df -hT /home Filesystem Type Size Used Avail Use% Mounted on /dev/vda1 ext4 79G 7.4G 67G 10% /
Display Disk Space Usage Information of File System in Bytes
‘-k‘ option help you to display all file system information and usage in 1024-byte blocks.
Usage Information of File System in MB
You can use ‘-m‘ option to display Disk Space information of file system usage in MB (MegaByte) .
Display Disk Space Usage Information of File System in GB
Use ‘-h‘ option to display Disk Space information of file system usage in GB (Gigabyte).
File System Type
Use option ‘T‘ to check the file system type of your system . It will show the file system type and other information as following:
Display Help Information of DF Command
‘–-help‘ switch will display a list of available options that are used with df command.