HostArmada Web Hosting Knowledge Base

Knowledge is power! Use that power and achieve total and unconditional control over the Web Hosting Services!

The disk filesystem command.

You are going to find many tools online that can check the disk space usage for Unix based operating systems such as Linux. However, the most used one is a powerful built-in command called "df", which is short for "disk filesystem". You may use it without the need to install it, and by doing so you are going to receive a full review of the disk space utilization of the file system. In this article, we are going to go over a few examples of how you can use this command to check the disk usage of your Web Hosting Account.

Here is an example of the command when used without any flags:

[root@ger1 ~]# df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda        82051600 42098560  35768712  55% /
/dev/loop0       3076124    21868   2894668   1% /tmp
/dev/sdc        82438552 12400616  65827248  16% /backup 

In this state, it is quite unreadable as the data is in bytes. It is a common practice to read such type of information either in MegaBytes or GigaBytes. To display the information in a human-readable format, please use the "-h" flag after the command which stands for "Human Readable":

[root@ger1 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda         79G   41G   35G  55% /
/dev/loop0      3.0G   22M  2.8G   1% /tmp
/dev/sdc         79G   12G   63G  16% /backup 

As you can see, it is far more understandable, and you can get a better idea of the disk utilization on your server. This command can serve one more purpose - display the inode status of the server (file count). To do that, please type it in, using the "-i" flag, which stands for "inodes".

[root@ger1 ~]# df -i

Filesystem      Inodes   IUsed   IFree IUse% Mounted on
/dev/sda       5088000 1223372 3864628   25% /
/dev/loop0      199600    1803  197797    1% /tmp
/dev/sdc       5242880     295 5242585    1% /backup

Again, without the "-h" option, the information is going to be somewhat challenging to read, therefore we recommend adding the "-h" flag. When applied, one thousand (1000) is going to change to "1K", one million (1 000 000) is going to change to "1M" giving you a much better idea:

[root@ger1 ~]# df -ih
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/sda         4.9M  1.2M  3.7M   25% /
/dev/loop0       195K  1.8K  194K    1% /tmp
/dev/sdc         5.0M   295  5.0M    1% /backup

Was this article useful and on point?

Find out more about HostArmada entire range of optimized Web Hosting Services and take action today on improving your website Loading Speed, Security, and overall Stability!