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