How to Safely Erase Ubuntu ‘Thumbnails Directory’ (Free Up Disk Space)

Just like Windows, Ubuntu Linux automatically generates small preview thumbnails for your photos and videos so they display nicely in the file manager. However, Ubuntu is notoriously aggressive about caching. If you plug in a USB drive containing 10,000 photos, Ubuntu will quietly generate 10,000 thumbnails and save them permanently to your main hard drive.

Over several years, this hidden cache can swell to multiple gigabytes in size, silently eating up valuable space on your SSD. If you are running low on disk space, you can safely erase this massive, hidden folder without damaging any of your actual photos.

How to Safely Erase the Ubuntu Thumbnails Directory

You must use the terminal to permanently delete the contents of the hidden `.cache/thumbnails` folder.

  1. Open your Terminal application (Ctrl + Alt + T).
  2. First, let’s check exactly how much space this hidden cache is wasting. Type the following command and press Enter: du -sh ~/.cache/thumbnails
  3. The terminal will output the size (for example, 3.2G).
  4. To safely and permanently erase all the cached images, type this command carefully: rm -rf ~/.cache/thumbnails/*
  5. Press Enter.

The command executes silently and instantly. You have successfully reclaimed that gigabyte of wasted space. You don’t need to worry about breaking the file manager; the next time you open a folder of images, Ubuntu will simply generate new thumbnails on the fly for the files that actually exist.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.