Freeing Up Disk Space
There are often situations where you need to perform a disk space check on your Ubuntu server. Perhaps you checked the dashboard widget and saw your disk usage was too high, or you received a warning about a backup failing, and you ended up here.
The Disk Usage Command
To quickly hunt down files or folders taking up your disk space, you can make use of the
du command, combined with the
sort command, to examine any directory on your server. Using these two commands, along with a specific series of switches, you will be able to pinpoint files and directories on the server that are taking up disk space.
You can start by running the following command on any SpinupWP managed server.
sudo du -sh /* | sort -hr
This will return a list of the directories and files in the server root directory, along with the size of each item, ordered by size.
By ordering the results by size, you can see the directories (or files) at the top of the list that are taking up the most space.
Check out our step-by-step guide on how to use these commands to hunt down high disk space usage culprits.