Using ncdu to Discover What Was Taking Up All That Space on My Web Server

A couple of months ago, I realized something was using an absurd amount of storage on the Ubuntu server that hosts this website. I have a 480 GB primary SSD, and running df showed that 80 percent of it was in use.

I knew that back in 2024, I was using around 40 percent of the space, so somewhere there was a file or directory that was using up a lot of space, but I had no idea where to start looking.

I was able to quickly drill down to the offending directory using ncdu.

First, I needed to install the package on Ubuntu:

sudo apt install ncdu

Then it was a matter of running:

sudo ncdu /

That gave a list of all the top-level directories and the total amount of space they were using, which looks something like this.

ncdu screenshot
ncdu screenshot

From there, I took the largest directory and ran ncdu to find out which subdirectories were taking the most space there.

sudo ncdu /[directory]

After iterating this way a few times, I found an old backup file from 2024 that was taking up ~160 GB and had never been deleted.

Problem solved.

Steiner Math Solves The Gorilla vs. 100 Men Problem