Linux free disk space FAQ: How do I show free disk space on a Unix or Linux system?
df command stands for "disk free". It is meant to show Linux disk space information, including disk space that is used, disk space remaining, and how filesystems are mounted on your Linux (or Unix) system. The Linux
df command not only shows the free disk space on your local computer, it also shows the free disk space on all networked filesystems that are mounted by your Linux system.
Here's the most basic example of Linux
df command, with output shown here from a CentOS Linux computer:
$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/vzfs 10485760 5713424 4772336 55% /
Rather than try to explain that particular output, let me say that I never use the
df command that way any more. Instead, I always use the
-h option to the
df command, like this:
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/vzfs 10G 5.5G 4.6G 55% /
-h option stands for "human readable", so as you can see, my current Linux system has one filesystem, and it is mounted as
/ (the root filesystem), and it is a 10GB filesystem, with 5.5GB used, 4.6GB available, and it is 55% used (which is pretty easy to see with round numbers like this example).
While my current Linux system has only one filesystem, which is mounted as the root directory (
/), my Mac OS X 10.5.x system (which is a Unix-based operating system) has several filesystems, and I can also see its "disk free" information with the Unix
$ df -h Filesystem Size Used Avail Capacity Mounted on /dev/disk0s2 93Gi 82Gi 11Gi 89% / devfs 107Ki 107Ki 0Bi 100% /dev map -hosts 0Bi 0Bi 0Bi 100% /net map auto_home 0Bi 0Bi 0Bi 100% /home
As you can see, this Mac has four filesystems that are mounted on /, /dev, /net, and /home. You can also see that the format of this output is a little different than the format from my CentOS Linux system. (And most importantly for me, you can see that my primary 93GB filesystem is 89% full -- yikes, I have to go!)
If you have Linux or Unix
df command examples you'd like to share, including output from other systems, feel free to share that output in the comments section below. As usual, you can also look at your Linux/Unix
man page on the
df command to get more help, like this:
$ man df
For your convenience, I've now included on online version of the Linux df command man page on this website.