.thumbnails eating up space in $HOME

I have a restriction of 50K # of files that can be created in the $HOME folder at work and for no apparent reason I reached that limit a couple of days back. So, there was something that had created 50K files in $HOME and I did not know about it.

Ran the following:

$ for x in `find $HOME -name "[.]*"`; do echo "$x has `find $x | wc -l` file"; done

The result listed a folder $HOME/.thumbnails that had around 47776 files. It appears that Nautilus creates thumbnails of every picture or PDF that you have opened. However, Nautilus does not delete the files.

If you have such a restriction and need to get rid of these files, add a crob job that does deletes the files older than 7 days.

$ find ~/.thumbnails -type f -atime +7 -exec rm {} \;

Another method is to change the Gnome settings. Run the following:

$ gconf-editor

Under desktop -> gnome -> thumbnail_cache change the values for maximum_age and maximum_size