Gnome saves thumbnails for most document types. This process can speed up subsequent viewing of files, but it can also be problematic:
- The number of files is not limited (this can be addressed with gnome-tweak) nor is the overall space occupied by thumbnails.
- Thumbnails leave a trail of what you have been downloading or looking at (cough porn cough).
So I put together this really simple script to delete all of my thumbnails at shutdown (replace USERNAME with your username):
#!/bin/sh
#Delete all USERNAME thumbnails when shutting down
rm -rf /home/USERNAME/.thumbnails/normal/*
rm -rf /home/USERNAME/.thumbnails/fail/gnome-thumbnail-factory/*
Place this script in the /etc/init.d/ directory and make sure that it is executable by root by issuing chmod 755. Then, create symbolic links to the correct run levels (0 and 6):
sudo ln -s /etc/init.d/delete-USERNAME-thumbs /etc/rc0.d/K10delete-USERNAME-thumbs
sudo ln -s /etc/init.d/delete-USERNAME-thumbs /etc/rc6.d/K10delete-USERNAME-thumbs