How to know the free disk space on a Linux server

The command used to find out what disk volumes you have on the server is “df”

df

Only this way it shows you the spaces in bytes, which is sometimes very difficult to read. So we generally use the “-h” flag to show you the values ​​in “Gigs”, which is much easier to read.

df -h

You will see that several lines appear, because in linux systems you always have several assigned partitions. There will be one of them that will usually have the most space, the one that is your main volume and from which you can check how much free space you have left on the server.

Filesystem Size Used Avail Use% Mounted on udev 7.2G 0 7.2G 0% /dev tmpfs 1.5G 680K 1.5G 1% /run /dev/sda1 49G 16G 33G 33% / tmpfs 7.2G 0 7.2G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 7.2G 0 7.2G 0% /sys/fs/cgroup /dev/sda15 105M 3.6M 101M 4% /boot/efi tmpfs 1.5G 0 1.5G 0% /run /user/1000

For example, in this case we have a server with a 50 GB disk, which has a main partition of 49 GB (it will always be a little less than the total disk). Of that partition we have 33 GB free and 33% of the space has been used.

See also  Which CSS selector to use to select an input field that has the name="search" attribute?
Loading Facebook Comments ...
Loading Disqus Comments ...