The df command (short for disk free), is used to display information related to file systems about total space and available space on the drive.
In this context, we shall look into how to use the df command in Linux.
What is the df command Syntax in Linux?
The df command takes the following format:
$ df [options]... filesystem…
The [options], is explained below.
1. -h display size in human-readable format:
$ df -h
2. -a show information of all file system disk space usage:
$ df -a
3. -k show information of the file system in Bytes:
$ df -k
4. -m show information of the file system in MB:
$ df -m
5. -i display file system inodes:
$ df -i
6. -T display type of file system:
$ df -T
7. -t show information of certain file.
for example, to display ext4 system, simply execute the command:
$ df -t ext4
8. -x exclude information of certain files.
For example, If you do not want to display ext4 system, run the command:
$ df -x ext4
9. If you use df command without [options], it will display all the information of the mounted file systems