How to check the disk space on a Linux server?
Keeping an eye on disk space usage is critical for a server to stay healthy. The last thing a system admin wants is a system to run out of disk space. So, how does a Linux System Administrator checks his server for used and available disk space? Use Putty or your favorite SSH client and logon to your server. Switch to the root user once you are logged.
Then execute the following command:
[email protected] [~]# df
This command will show you the disk space among your partitions in KB size.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 37167560 14344212 20935312 41% /
/dev/hda1 256667 27790 215625 12% /boot
/dev/hdc1 38464340 16535548 19974888 46% /backup
none 766696 0 766696 0% /dev/shm
/dev/tmpMnt 806288 17416 747912 3% /tmp
If you want to see your server disk space in Gigabyte data change the command as shown in our next example:
[email protected] [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 36G 14G 20G 41% /
/dev/hda1 251M 28M 211M 12% /boot
/dev/hdc1 37G 16G 20G 46% /backup
none 749M 0 749M 0% /dev/shm
/dev/tmpMnt 788M 18M 731M 3% /tmp
I make it a habit to check servers whenever I log into one via SSH. Next to using the "top" command, checking the disk space is one of my high priority items.