Introduction
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…
[options]
-h display size in human-readable format
$ df -h
Output:
-a show information of all file system disk space usage
$ df -a
Output:
-k show information of the file system in Bytes
$ df -k
output:
-m show information of the file system in MB
$ df -m
Output:
-i display file system inodes
$ df -i
Output:
-T display type of file system
$ df -T
Output:
-t show information of certain file
for example, I will display ext4 system:
$ df -t ext4
Output:
-x exclude information of certain files
For example, I don’t want to display ext4 system:
$ df -x ext4
Output:
If you use df command without [options], it will display all the information of the mounted file systems
Output:
Conclusion
You’ve already gone through the details of how to use the df command in Linux.
Thanks for reading.