How the heck do you figure out how much disk space you have available on an Ubuntu Linux computer?
Ah Linux. Even with all the years of graphical interface development, there’s still a certain level of geek perspective that infuses the entire experience. Which is to say, it’s not so easy to get a simple answer to the question “how much free disk space do I have?” unless you know where to look…
Admittedly, disk space is a complicated thing to calculate in Linux because not only do you have physical hard drives that can split up into partitions, but Linux loves those virtual drives and virtual mount points too, so a single physical drive can appear as a dozen or more “external volumes” on a typical Linux setup. Then there’s the complexity over clarity philosophy of the major tools that err on the side of offering up exhaustive technical details that make it pretty tricky for less tech users to get a simple answer.
And then there’s the command line…
In fact, let’s start there. You can get the answer you seek with a simple command in the Terminal: df -H. I’ll add –local to ensure no remote disks show up in output, but you can see, it’s crazy complicated considering it’s ONE drive we’re talking about:
$ df -H --local Filesystem Size Used Avail Use% Mounted on udev 1.1G 0 1.1G 0% /dev tmpfs 207M 1.7M 205M 1% /run /dev/sda1 22G 9.3G 11G 47% / tmpfs 1.1G 0 1.1G 0% /dev/shm tmpfs 5.3M 4.1k 5.3M 1% /run/lock tmpfs 1.1G 0 1.1G 0% /sys/fs/cgroup /dev/loop0 93M 93M 0 100% /snap/core/6964 /dev/loop1 4.4M 4.4M 0 100% /snap/gnome-calculator/406 /dev/loop2 45M 45M 0 100% /snap/gtk-common-themes/1313 /dev/loop3 158M 158M 0 100% /snap/gnome-3-28-1804/67 /dev/loop4 16M 16M 0 100% /snap/gnome-logs/45 /dev/loop5 4.4M 4.4M 0 100% /snap/gnome-calculator/352 /dev/loop6 58M 58M 0 100% /snap/core18/1055 /dev/loop7 4.0M 4.0M 0 100% /snap/gnome-system-monitor/100 /dev/loop8 1.1M 1.1M 0 100% /snap/gnome-logs/57 /dev/loop9 57M 57M 0 100% /snap/core18/970 /dev/loop10 2.4M 2.4M 0 100% /snap/gnome-calculator/238 /dev/loop11 16M 16M 0 100% /snap/gnome-characters/296 /dev/loop12 4.0M 4.0M 0 100% /snap/gnome-system-monitor/83 /dev/loop13 38M 38M 0 100% /snap/gtk-common-themes/1198 /dev/loop14 148M 148M 0 100% /snap/gnome-3-26-1604/90 /dev/loop15 93M 93M 0 100% /snap/core/7270 /dev/loop16 16M 16M 0 100% /snap/gnome-characters/280 /dev/loop17 1.1M 1.1M 0 100% /snap/gnome-logs/61 /dev/loop18 159M 159M 0 100% /snap/gnome-3-28-1804/51 /dev/loop19 148M 148M 0 100% /snap/gnome-3-26-1604/86 tmpfs 207M 29k 207M 1% /run/user/1000 total 26G 11G 15G 43% -
Got all that? In fact, it’s the last line that answers the question: there are 26G in total, of which 11G are in use and 15G is free, meaning I’m using 43% of my drive capacity. Heck, you could just use df -H –local | tail -1 and get rid of everything else to just see the totals!
But let’s look at the other options on Ubuntu Linux since there is a graphical interface and perhaps you don’t want to delve into the command line world!
To start, using the File Manager, click on “Other Locations” on the lower left and you’ll get a summary of all your drives:
A useful summary: The main drive has 11.2 GB out of 21.0GB available. But here’s a cool trick: Click on “Computer” then choose “Properties” and you’ll see a pie chart (albeit one that really needs some color, but we’ll get back to color disk display momentarily!) that shows you the same information in a more visual fashion:
See how those numbers don’t really add up? 7.7GB of contents that add up to 8.6GB used? Don’t worry about it, that’s just Linux doing its behind-the-scenes magic to ensure that your file system works. To get more information, youc ould click on “Open in Disks”, but let’s go through a different path to get there instead…
Quit File Manager, then type in ‘disk space’ to the help system:
That first option is exactly what you seek: Check how much disk space is left. Choose it and you’ll get a help page offering up two graphical apps that can answer the question:
Long story short, you have two options: Disk Usage Analyzer and System Monitor. The former certainly sounds promising, so quick launch it by clicking on “Activities” on the top left…
In the resultant search box, type in “disk usage” to get the matching app:
If you guessed that a click launches it… you’re right! It’ll take a few seconds to collect the data needed, but the top level view actually offers up some of the information you seek anyway:
11.8GB of 21GB available. Which is a bit odd since it doesn’t agree with the df command above (which showed 15GB available of 26GB). Probably the difference is that Disk Space Analyzer knows to omit swap space and other virtual file systems that aren’t available for user data and files. 4GB of ’em, apparently!
Where Disk Space Analyzer gets fun – or fires up a migraine, if you’re not techie! – is when you click on a file system to dig into the space utilization:
Got that? All color coded and no legend, so it’s pretty complicated. Each ring segment represents an app, program, data storage area or really big file, and you can click on them to learn more about each one. Or just hover your cursor over a segment to get some info on it:
I find this quite baffling, personally, but I’m sure there are plenty of people who look at this and say ahhh gotcha! that’s where all my disk space has gone!
Anyway, there you go, two different solutions to the problem of figuring out free disk space on your Ubuntu Linux system. Hope that helps out!