What is cache directory in linux

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

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.

@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 🙂

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.

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

$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.

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.

Читайте также:  Linux mint image docker

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.

Источник

Purpose of ‘~/.cache’ directory and when is it safe to delete? [duplicate]

What is the purpose of every user’s ~/.cache directory? Under which circumstances can it be deleted, when should one be careful about its contents?

1 Answer 1

This is by no means a definite answer.

According to the XDG Base Directory Specification, $XDG_CACHE_HOME which defaults to $HOME/.cache holds

It is however not specified what constitutes ‘non-essential data’. Furthermore an application might not play by freedesktop rules and put whatever it wants in .cache .

Browsing through my cache folder, I find things like

  • Browser caches. Safe enough to delete.
  • Thumbnails. Will be recreated if deleted.
  • software-center . Wasn’t sure about that. Contains a file apthistory.p with your — well — history of apt. Moved it out of the way and it was recreated on the next start of the Ubuntu Software Center.
  • I guess the Software Updater stores package lists apt-file . Will be downloaded anew if deleted.
  • icon-cache. Like thumbs, will also be recreated.
  • compizconfig-1 . Contains binary files; compiz seems to cache its configuration in optimized form from ~/.config/compizconfig-1 .
  • dconf . This directory actually doesn’t belong to $USER but root. Mine contains a single non plaintext file user . Since you can’t delete it anyway without sudoing. No problem.
  • And some more directories which I don’t deem critical.
Читайте также:  File system gnu linux

In summary, I believe it perfectly safe to empty the cache folder. In fact I do this from time to time and never experienced faulty behaviour afterwards.

This is not a guarantee though, just my two cents and a (somewhat) educated guess.

Источник

ubuntu clear user cache

To delete a cache, select the entry and then click the Clean button present at the bottom-right corner of the tool’s UI. Before you jump in and start cleaning everything using Ubuntu Cleaner, keep in mind that caches are there for a purpose (as was explained in the beginning of the tutorial).

Is it safe to delete user cache?

It’s not bad to clear your cached data now and then. Some refer to this data as “junk files,” meaning it just sits and piles up on your device. Clearing the cache helps keep things clean, but don’t rely on it as a solid method for making new space.

Can I delete home user cache?

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 lose custom configurations, but no real harm to the system.

Where is cache folder in Ubuntu?

Cache file location. A lot of cache files are stored in the . cache folder in the home directory. Each user on a Linux OS has a .

How do I clear my apartment cache?

The clean command clears out the local repository of downloaded package files. It removes everything except the partials folder and lock file from /var/cache/apt/archives/ . Use apt-get clean to free up disk space when necessary, or as part of regularly scheduled maintenance.

How do I clear apt-get cache?

You can run ‘sudo apt-get clean’ to clean out any cached .

Can I delete cache files?

Older Android versions gave you the option to delete all cached files at once by going to Settings > Storage > Cached Data. From there, simply tap OK when you see the option to delete all cache files. Unfortunately, there’s no built-in way to clear all the cache on modern versions of Android.

Does clearing cache delete passwords?

The answer is “No” and the passwords do not get deleted along with the cache if you proceed with clearing the cache without checking the checkbox before the ‘Passwords and other sign-in data’ field.

Читайте также:  Linux посмотреть сетевое оборудование

How do I empty the cache on my iPhone?

  1. Open your iPhone’s settings.
  2. Scroll until you see the eligible app, then tap it.
  3. Look for a «Clear cache» option. If the toggle next to it is green, tap it to clear the app’s cache.

How do I clean up my home directory in Linux?

Actually, the best way to clean you home folder is backup your personal document then rm -rf ~/*; rm -rf ~/. *. But if you have a heavy-configured desktop environment or other applications and you don’t know how to backup their configuration files, this is not a good choice.

What is cache in Linux?

Under Linux, the Page Cache accelerates many accesses to files on non volatile storage. This happens because, when it first reads from or writes to data media like hard drives, Linux also stores data in unused areas of memory, which acts as a cache.

Where cache files are stored in Linux?

Cache files are stored in /home/username/. cache which mostly consists of your browser’s data, IDE’s (if you use any ) and other software.

What is Cache tracker?

According to its website, “Tracker is a filesystem indexer, metadata storage system and search tool.” . This is because as well as searching for files in the traditional way, by name and location, Tracker searches files’ contents and metadata.”

What is cache directory?

Local cache directories on the server are only used with caches that use the compact storage type. The server writes one bundle file (which can include up to about 16,000 tiles) to the local cache directory. When complete, the bundle is moved to the shared cache directory.

How To Check Pod / Container Metrics on OpenShift

Openshift

How do you monitor OpenShift pods?How do you check a PODS container?How do I enable OpenShift metrics?How do I monitor my OpenShift cluster?How do I c.

Recover root password under CentOS

Root

Reset Root Password in CentOSStep 1: Access Boot Menu. Restart the system, then tap the Esc key about once per second to launch the GRUB menu.Step 2: .

How To Install And Use Shutter Screenshot Tool In Ubuntu 18.04

Shutter

Shutter Screenshot Tool Installation Through GUI The Ubuntu Software utility will open, from where you can search for Shutter by clicking the search b.

Latest news, practical advice, detailed reviews and guides. We have everything about the Linux operating system

Источник

Оцените статью
Adblock
detector