What does .cache do? It consumes a huge disk space

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.


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.

Tags:

Linux