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.

What is the ~/.local folder good for and is it safe to remove the content within this folder?

share|improve this question
add comment

2 Answers 2

up vote 37 down vote accepted

There is a recent innovation, followed by Gnome and thus by Ubuntu, to store user-specific data in fixed directories. According to this document, there is

  • a single directory where user data is stored, defaulting to ~/.local/share;
  • a single directory where configuration is stored, defaulting to ~/.config;
  • a single directory which holds non-essiential data files, defaulting to ~/.cache.

Historically, Unix programs were free to spread their data all over the $HOME directory, putting their data in dot-files (files starting with ".") or subdirectories such as ~/.vimrc and ~/.vim. The new specification is intended to make this behavior more predictable. I suspect this makes backups of application data easier, in addition to giving your home directory a tidier appearance. Not all applications adhere to this standard yet.

In the .local hierarchy, programs put user information such as emails and calendar events. You could manually remove this data, but then the program would lose its state; unless you this is what you intend (e.g. when there is a problem with your configuration), you shouldn't remove or change files in that directory. With .cache you can be more careless as the program should be able to recover - redownload or recompute - all the files if you remove them.

share|improve this answer
    
.local is for storing user program data (like locally installed programs), not user data (like photos, calendars etc) –  Martin Owens -doctormo- Nov 23 '10 at 13:55
    
I don't think you're right. Two interpretations of the specification are possible: (1) .local/share is supposed to be used in a way analogous to /usr/share, e.g. to override icons; and (2) applications are permitted to write state to subdirectories of .local/share. The existence of ~/.local/share/trash/ implies that at least some applications favor the second interpretation. Granted that .local is used to install local versions of software from source. But it is apparently also used to store data similar to ~/.firefox. –  loevborg Nov 23 '10 at 14:11
3  
It seems like .config and .cache should be inside .local for consistency, shouldn't they? –  Piotr Dobrogost Jul 24 '13 at 21:45
add comment

The .local/ directory is used by some softwares to keep your preferences (as pointed by @loevborg). This directory is part of the effort to standardize the mess that is the $HOME user. But unfortunately many software not yet joined this effort, even some gnome software still are spreading your preferences in others directory (see .gnome2, .gconf, .evolution, etc).

It is save to remove the directory! the only consequence you will suffer if you remove this directory is that some software will probably lose their preferences, thus booting more slowly.

I suggest that you examine carefully what subdirectories inside .local/ you do not use, removing them and keeping the ones you most use. Thanks!

share|improve this answer
5  
"It is save to remove the directory!" - No it isn't!!!! Tomboy stores its notes in there as I discovered to my cost. Bad advice. –  Tim Abell Jul 25 '12 at 18:39
2  
I'm sorry, but I have to downvote for your suggestion that it is safe to remove this directory when it certainly isn't. –  Timo Kluck Aug 3 '12 at 10:48
add comment

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.