How to Completely Erase Ubuntu ‘Thumbnails Cache’ (Clear Image Previews)

When you open the file manager in Ubuntu Linux and navigate to a folder full of photographs or videos, the operating system instantly generates a tiny preview image (a thumbnail) for every single file. To make browsing faster in the future, Ubuntu permanently saves these generated thumbnails in a hidden, centralized cache folder on your hard drive.

Over time, this hidden cache will swell to thousands of files. Worse, if you delete a private photograph from your computer, the thumbnail preview of that photo often remains secretly stored in the cache. Anyone who knows where to look can reconstruct a timeline of the images you’ve viewed. To reclaim disk space and protect your privacy, you should manually purge the thumbnail cache.

How to Completely Erase the Ubuntu Thumbnails Cache

You must use the terminal to delete the contents of the hidden ~/.cache/thumbnails directory.

  1. Open your Terminal application (Ctrl + Alt + T).
  2. To completely obliterate the entire cache and force Ubuntu to start over, carefully type the following command exactly as written: rm -rf ~/.cache/thumbnails/*
  3. Press Enter. Because this command affects only your specific user account’s cache, it will not ask for an administrator password. It will execute instantly and silently.

What did this do?

The rm -rf command aggressively deleted all the folders inside the thumbnails directory (which usually includes folders named normal, large, and fail). Every single ghost preview of deleted images has been permanently wiped from the SSD. The next time you open a folder full of pictures, the file manager might take a fraction of a second longer to load as it generates a fresh set of thumbnails for only the files that currently exist.

Get the best tech tips delivered straight to your inbox.

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