Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I use disk usage analyzer and scan my home folder .cache always shows up with a decent bit of things in it. Would it be okay for me to delete the contents of this folder or would it damage something?

share|improve this question
    
My .cache was 11G –  Casey Aug 17 '13 at 0:16
    
Possible cross site duplicate of: superuser.com/questions/366771/… –  Ciro Santilli Mar 16 at 21:34

3 Answers 3

To answer the question, IMO you can delete all of .cache with no long term detrimental effects.

If your .cache is growing large, it might be better to look at the contents and determine what application is making it large and re-configure a bad acting application (rather than simply deleting .cache when it grows too large).

Another directory that can take up a lot of space (and/or save an embarrassing bit of evidence) is the .thumbs directory. Many files in .thumbs seem to be duplicates.

To clean (just take care with the -rf flag and other directories ;)

rm -rf ~/.thumbs/*

When you are new to Ubuntu/Linux it is hard to know what you can and can not delete in your home directory. For the most part you can delete most anything in your home directory, programs or applications that require .cache (or other dot files such as .local) will re-create them.

Most of the time, at worst, you will loose custom configurations, but no real harm to the system.

I would not advise you start a habit of deleting things you do not understand in your home directory, back it up or use a test account. If in doubt, the safe thing would be to make a back up or move the file.

mv .cache .cache_backup

You can then restore from backup if needed.

Definitely do NOT start deleting things you do not understand outside of your home directory.

share|improve this answer

It is generally safe to delete it. You might want to close all graphical applications (e.g. banshee, rhythmbox, vlc, software-center, ..) to prevent any confusion of the programs accessing the cache (where did my file go all of a sudden!?).

It can easily have a size of 100+ MB, so if you want to free up disk space, do it.

As already pointed out by BretD and Dylan McCall, the type of files are partial downloads, browser cache, media files like icons, etc, used to speed up future access to the same files.

Another thing to keep in mind: removing an application does not necessarily delete the relevant ~/.cache/removed_prog folder; in this case those files just take space and are not used. Those can definitely be deleted.

share|improve this answer

I would recommend not deleting it. I am not a Linux expert (though I hope to be!) and don't know the specifics of the file system structure, but you can examine what exactly is in the folder by going into your home folder and hitting ctrl+h to show hidden folders. You can then go in the .cache folder and see what's in there.

Just from a quick peek on my system I know that banshee stores album art in the cache folder (don't know why exactly), chrome has data in the cache folder, a lot of programs keep logs in the .cache folder, and other stuff.

I am not sure if these files are all just there temporarily for speed increase purposes (like browser cache) or if this "cache" contains files for some other purpose (as the speed increase of browser cache is to counteract excessive use of bandwidth by re-accessing files on a server, whereas there should be no discernible difference in r/w times for a different file location on the hard disk).

I hope someone knows more about this than I do and can give you a better response.

share|improve this answer
    
Yes, I agree that it isn't a good idea to delete .cache. If possible, use the program that creates the relevant folder. Deleting Chrome's cache, for example, should preferably be done via Chrome. If a program doesn't offer a visible means of managing its cache, it may be safer to leave it alone unless one really knows. –  user25656 Feb 7 '12 at 5:13
    
One more thing you could consider if you don't dislike using the terminal and typing commands is this: du ~/.cache > cachefolders_size. What it does is to give you a list with sizes of each folder in .cache. You can paste the information from the file generated into a spreadsheet and then sort it to your taste. I read about it here. –  user25656 Feb 7 '12 at 5:34
12  
The idea of .cache is that it is deletable (see standards.freedesktop.org/basedir-spec/basedir-spec-latest.html). Applications shouldn't depend on it, and I really have never noticed an application doing it wrong. Banshee is indeed a funny case, but it's a great example: BretD is right that you probably won't want to delete all your cache, because it is generally there for a good reason. It takes a long time for Banshee to get cover art. It can do it again, but it will look ugly in the interim. –  Dylan McCall Feb 7 '12 at 6:41
    
@vasa1 or you can use a GUI-based disk usage analyzer. I think Baobab, should be available on Ubuntu (I use it in Debian) –  Alois Mahdal Nov 25 '13 at 2:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.