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.

19.8G  /sites
1.9G    /var
1.7G    /usr
503M    /snap
145M    /boot
12M     /opt
7.8M    /etc
4.0M    /cache
3.0M    /home
1.6M    /root
992K    /run
64K     /tmp
16K     /lost+found
4.0K    /srv
4.0K    /mnt
4.0K    /media

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.

Start Your 7-Day Free Trial

Start your SpinupWP journey today and spin up your first server within minutes.

Start Your Free Trial

No credit card required

Subscribe to get the latest news, updates and optimizations in performance and security.

Thanks for subscribing 👍

To receive awesome stuff, you'll need to head to your inbox and click on the verification link we sent you.
Make sure to check your "spam" folder or your "promotions" tab (if you have Gmail).
If you're still having trouble, then messages us at sudo@spinupwp.com.

You are already logged in

It looks like you are already logged in to SpinupWP.

Please log out of this account to continue.

Registration Successful

Thanks for registering for a new
SpinupWP account.

Before getting started, could you verify your email address by clicking on the link we just emailed to you?

SpinupWP

Free Trial

Start Your 7-Day Free Trial

No credit card required. All features included.

By signing up to SpinupWP, you agree to our Terms and Conditions.
For privacy related information, view our Privacy Policy.