You don’t know how much space is available on your hard drive, do you? Not sure if your hard drive has enough space to install a large file or application? Let’s use the df command.
df command is used to check the available space and total space on the drive.
This article will show you how to use the df command in Linux as we go through below.
The syntax of df command
$ df [options]... filesystem…
-h display size in human-readable format
$ df -h
-a show information of all file system disk space usage
$ df -a
-k show information of the file system in Bytes
$ df -k
-m show information of the file system in MB
$ df -m
-i display file system inodes
$ df -i
-T display type of file system
$ df -T
-t show information of certain file
for example, I will display ext4 system:
$ df -t ext4
-x exclude information of certain files
For example, I don’t want to display ext4 system:
$ df -x ext4
If you use df command without [options], it will display all the information of the mounted file systems
You’ve already gone through the details of how to use the df command in Linux.
Thanks for reading.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.