home directory – Is it okay to delete ~/.cache? – Ask Ubuntu

home directory – Is it okay to delete ~/.cache? – Ask Ubuntu

This will delete everything in your .cache that was last accessed more than a year ago

find ~/.cache/ -type f -atime +365 -delete

If you’re nervous about running it, this will show you what’s going to be deleted:

find ~/.cache/ -depth -type f -atime +365 

I’m using ‘access time’ for that, you could also try ‘creation time’ by using -ctime (although I’ve found many cache files which are years old but still accessed). Thanks to @n33rma for the edit suggestion.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.