How to check disk space on Linux CLI

This is a quick reference guide to check disk space on Linux Based Operating Systems.

root@VPS:/etc# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              491664       0    491664   0% /dev
tmpfs             100916    5532     95384   6% /run
/dev/vda1        9983232 1560296   8406552  16% /
tmpfs             504576       0    504576   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs             504576       0    504576   0% /sys/fs/cgroup
/dev/vda15        106858    3668    103190   4% /boot/efi
tmpfs             100912       0    100912   0% /run/user/0

The df command shows information about the file system on which each FILE resides, or all file systems by default.

df -a 

The df -a option includes pseudo, duplicate, inaccessible file systems.

df -h

The df -h option will give you human readable content – print sizes in powers of 1024 (e.g., 1023M)

df --help

The df –help option will give you all the options that can be used with the df command.

Below is an example of df -h

root@VPS:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            481M     0  481M   0% /dev
tmpfs            99M  5.5M   94M   6% /run
/dev/vda1       9.6G  1.5G  8.1G  16% /
tmpfs           493M     0  493M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           493M     0  493M   0% /sys/fs/cgroup
/dev/vda15      105M  3.6M  101M   4% /boot/efi
tmpfs            99M     0   99M   0% /run/user/0
root@VPS:~#

If you are new to the world of Linux, an avid Linux enthusiast or a student why not try our 0.99p per month Linux VPS.

Simply click on the screen shot below to find out more or navigate to https://piggybank.cloud

Thank you for reading and please feel free to leave any feedback.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s