How to check free disk space on a linux server

Question: How do I check the amount of free disk space on a FreeBSD server?

Answer: The best way to check how much free disk space your FreeBSD server has available is by using the df command. This works on linux/unix servers, not just FreeBSD. After you SSH into your server you can either type “df” (df means disk free) which will show you the raw numbers or you can type “df -h” which means human readable and makes the output easier to read by displaying it in kilobytes, megabytes, and gigabytes instead of the default kilobytes.

linux server

Here’s how it looks like in action. The first section I typed df and hit enter, the second section I typed df -h and hit enter.

$ df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s1a 128990 60892 57780 51% /
/dev/ad0s1f 257998 1440 235920 1% /tmp
/dev/ad0s1g 155014798 126948208 15665408 89% /usr
/dev/ad0s1e 257998 10454 226906 4% /var
procfs 4 4 0 100% /proc
/dev/ad3s1c 384602638 13645514 340188914 4% /usr/www/virtual/yyy/drive2
$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad0s1a 126M 59M 56M 51% /
/dev/ad0s1f 252M 1.4M 230M 1% /tmp
/dev/ad0s1g 148G 121G 15G 89% /usr
/dev/ad0s1e 252M 10M 222M 4% /var
procfs 4.0K 4.0K 0B 100% /proc
/dev/ad3s1c 367G 13G 324G 4% /usr/www/virtual/yyy/drive2
$

Some commands explained
There are two ways to check space on your drive. One is the df (disk free) command which tells you how much free disk space is available for each mount you have and the other is the du (disk usage) command which reports the sizes of directory trees, their contents, and the sizes of individual files. The du command is helpful when you are trying to find files that take up a lot of space.

Related posts

0 Responses to “How to check free disk space on a linux server”


  1. No Comments

Leave a Reply