Home » Linux » Shell » Ubuntu Check Disk Space

Checking for Available Disk Space on Ubuntu [Guide]

This simple guide explains how to check how much disk space is available in Ubuntu Linux.

The df command tells you how much space is being used on each storage volume attached to your Linux system. To run it, simply execute the following command in your terminal:

df

Which outputs:

df command output
df command output

Easy! But, it’s a bit difficult to read at a glance – the -h option makes everything human-readable:

df -h

Which outputs:

df -h command output
df -h command output

However, there’s a lot of junk in there- we can ignore the /dev/loop* entries by omitting filesystems of the squashfs type:

df -h -x squashfs

Which gives a tidier looking:

df -h -x squashfs
df -h -x squashfs

Your main disks will most likely be named /dev/sda or /dev/sdb, so you can easily find them in the list and see how much space is available.

You can also find them in the list by checking the size of the volume and matching it to the disk you are investigating.

SHARE:
Photo of author
Author
I'm Brad, and I'm nearing 20 years of experience with Linux. I've worked in just about every IT role there is before taking the leap into software development. Currently, I'm building desktop and web-based solutions with NodeJS and PHP hosted on Linux infrastructure. Visit my blog or find me on Twitter to see what I'm up to.

Leave a Comment