24

What does it do? Is it ok to delete all of its content? It consumes 14GB of my hard disk already.

4
  • Where is this file?
    – soandos
    Dec 11, 2011 at 6:29
  • At kubuntu, in my case, it is located in user home folder and has 251 MB.
    – bbaja42
    Dec 11, 2011 at 6:32
  • @Amumu, could you show what is in that folder? ls -al .cache
    – bbaja42
    Dec 11, 2011 at 6:35
  • @soandos it is located in ~/
    – Amumu
    Dec 11, 2011 at 8:35

4 Answers 4

7

In my .cache folder, in Kubuntu, there are files from Chromium (internet browser), VLC (media player) and files from apt (package updates).

I've just deleted them, and tried to use Chromium, VLC and apt-get. They all "seem" to work.

P.S. This is far from a good answer, a good answer should give an explanation why is there default .cache folder and when and how it should be deleted.

P.P.S. If you are thinking of just deleting it, make sure to check which programs are using it, and restart them.

3
  • Caching is usually used to speed up some processes. I have no experience with this in linux however.
    – soandos
    Dec 11, 2011 at 7:21
  • 2
    @bbaja42 The cache seems to be normal again. Don't know what caused it to eat up a lot of space. It's good to know deleting won't hurt the system. And, I agree with you for having a detailed answer would be better, but in case no one cares, I will accept your answer since at least you care :)
    – Amumu
    Dec 11, 2011 at 8:38
  • Probably a good idea to first close all running applications, then delete or move the .cache folder. You might not be able to delete files that are currently in use. Apr 13, 2014 at 22:22
18

It’s a very old question, but I guess a more descriptive answer should go here.

From the Spec:

$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

So unless some running software is actively using this directory (e.g. most browsers store their cache, and some software store video/picture thumbnails here, too), it is generally safe to remove it. Before you do so, you may want to check its contents; the sub-directory names will show you which programs store their data there.

6

Since no one else has pointed this out, I think it might be good to note that "a cache" by definition is a 2nd copy of data existing elsewhere, and that 2nd copy is kept in the cache to help speed up access to this data.

For example with a web browser, the images, css files, etc. once downloaded are cashed if there is any chance they might be needed again. If they are missing from the cache, then the browser issues a http get and they are reloaded from the Internet. The browser checks only the modification time of the item, and if what is in the cache is the same as on the Internet it isn't downloaded again, but is rather just pulled out of the cache. (And if what's on the Internet is newer, then it's downloaded and the cache is updated.)

Therefore, at least in the case of a browser's cache, the cache information can be deleted at any point in time that the browser isn't running. The side effect is the next time you reload a web page it might take longer to display.

The apt cache is similar, to the best of my knowledge.

3

My system ubuntu 14.04. I would use 2 step procedure. I would first rename it say xxxcache. Then I try to use the progs that use .cache. Most likely they will create new .cache and put the recently info in it. In other words, they should all work, but they will not remember the past. I have no time to test it, but this what I would do. If something really does not work say chrome, or eclipse I would change xxxcache back. On my ubuntu there is about 30 progs that are using .cache. IMHO

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .