How to check disk space in Ubuntu
Recommended Ubuntu book
There are quite a few ways to check the hard drive disk space in Ubuntu. Lets look at the most popular ones.
1) Using GUI in Gnome – Just go to Applications > Accessories > Disk Usage Analyzer. Open it and it will show you used and free disk space. Easy, huh? Well, here is what else you can do – click filesystem scan and it will show you the usage of each individual directory and display it in a pretty graph.
2) Using command line. Now this is where it gets fun. There quite a few ways to check the disk space using the Terminal. One of the most popular is:
df
Now df by itself as you can see is confusing. Let’s try it with a flag:
df -h
A lot better, huh? -h flag stands for human readable format.
There are a lot of other tools you can add to make the command line look prettier and more user friendly. One such tool is discus (disc usage). Type:
sudo apt-get install discus
After installation you can just type in:
discus
and it will show you the stats in very friendly format. It is configurable, so check out
man discus
We can also use du command (discĀ usage) to show the size of the current directories. Type in Terminal:
du
and it will show you not too friendly output, try again using some flags
du -sh *
or
du -s -m *
-s stands for summary, -m to show it in megabytes, or you can once again use -h for human readable.
Check total free space in the system – use free CLI command. Open terminal and just type:
free
or
free -m
Once again, -m flag to show it in a nice format in Mb.
Do you need it to take one step further and check the CPU load and Memory Usage?
Use top command. Type in Terminal:
top
as you can see, it shows you the computer load and usage in real time. You can sort it while watching by pressing m key by memory, l by load, t by process time.
This is about it. You should now know how to check you system status, free and used space, cpu and memory usage.
It takes time to memorize these commands, but once you do it will be easy. Just remember that each command in Ubuntu is well documented and you can also do
man <command>
or try
<command> --help
to refresh the memory.