Manjaro Difference between revisions of "Important hidden .dot files in your home partition"

Difference between revisions of "Important hidden .dot files in your home partition"

From Manjaro
imported>Handy
(Created page with " ==What's a hidden <.dot> file?== They are files & directories with a "'''.'''" dot in front of them. Placing a "'''.'''" dot in front of a file or directory tells the opera...")
 
(Marked this version for translation)
 
(23 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<languages/>
__TOC__
<translate>


==What's a hidden <.dot> file?==
=What's a hidden <.dot> file?= <!--T:1-->


<!--T:2-->
They are files & directories with a "'''.'''" dot in front of them. Placing a "'''.'''" dot in front of a file or directory tells the operating system that such files & directories are to be hidden from view in file managers, file requesters & such. File managers & other applications can usually be set to view these normally hidden files. These hidden files & directories usually contain configuration files of some sort.


They are files & directories with a "'''.'''" dot in front of them. Placing a "'''.'''" dot in front of a file or directory tells the operating system that such files & directories are to be hidden from view in file managers, file requesters & such. File managers & other applications can usually be set to view these normally hidden files. These hidden files & directories usually contain config files of some sort.
<!--T:3-->
These hidden files will be referred to as ''<.dot>'' files in this article.


I will refer to these hidden files as ''<.dot>'' files in this article.
==Why is it worth knowing about these <.dot> files?==


=Why is it worth knowing about these <.dot> files?= <!--T:4-->


<!--T:5-->
* These files contain settings/configuration information that will often need to be modified


<!--T:6-->
* It is well worthwhile knowing which <.dot> directories & files in your ~/ directory are valuable in saving you time & effort if you have to reinstall Manjaro due to a hardware failure, corrupt data, user error...
* It is well worthwhile knowing which <.dot> directories & files in your ~/ directory are valuable in saving you time & effort if you have to reinstall Manjaro due to a hardware failure, corrupt data, user error...


<!--T:7-->
* If you are coming from, or going to another distro, this can be extremely valuable knowledge. As again, these <.dot> files can save you an enormous amount of time & effort in configuring your system to be just the way you like it. More on this to come.
* If you are coming from, or going to another distro, this can be extremely valuable knowledge. As again, these <.dot> files can save you an enormous amount of time & effort in configuring your system to be just the way you like it. More on this to come.


<!--T:8-->
* This knowledge can also be used to backup important config files, some of which can have had many, many hours of work in them.
* This knowledge can also be used to backup important config files, some of which can have had many, many hours of work in them.


==So, what do these <.dot> files in my /home do?==
Looking in your ~/ directory (in a fashion that allows you to see all of the hidden <.dot> directories & files) gives us the ability to identify (& backup) any folders that have config or other customised data for our system, including the DE or WM that we use, as well as our applications.


Some examples of these are; panels, trays, clocks, text editors, image viewers, pdf viewers & whatever else that has been installed & configured on our system. A quick look in your ''~/.config'' directory will make this clear.
=So, what do these <.dot> files in my /home do?= <!--T:9-->
{{note|<.dot> files are hidden by default. You usually need to enable them in your file manager or by using '''ls -A'''}}


==Here is a guide to get you going:==
<!--T:10-->
Looking in your '''~''' directory can identify any folders that have configuration or other customised data for our system, including the DE/WM and applications.


The following is a guide built from looking at my custom built Manjaro mongrel Openbox system. It has remnants of tried panels & the lal clock, xbmc & other stuff that I don't use. (Actually I deleted the .xbmc folder as it will never be used again.)
<!--T:11-->
Some examples of these are; panels, trays, clocks, text editors, image viewers, pdf viewers & other applications. A quick look in your '''~/.config''' directory will make this clear.


As far as your hidden files go you don't need all of them for reference or for use by copying directly into your new system. Looking at what's in there critically is a good learning experience as it helps you to become more familiar with your Linux system.
=A reference to key <.dot> files= <!--T:12-->


The following are hidden <.dot> directories & files that I would keep from my ~/ (this stands for my /home/<user.name> directory):
<!--T:13-->
The following represent some of the most common types of <.dot> files that are found directly in your home folder.  This is not an extensive list but represents some of the most common items.  


===Directories:===
<!--T:34-->
Whether the files are important or not cannot be judged in this article - it depends on how much time you have spent on customizing your configuration files. Some window managers can only be configured using these files - in that case they become important. Or you have a collection of scripts in ~/.local/bin - they have become important as they - often - represent a great amount of work.


==Directories== <!--T:14-->


'''.config''' - you can drop this whole directory into your new distro as it keeps settings for any apps, DE/WM that you have been using in your previous distro. (Some apps stick their settings elsewhere so have a look in your ~/ for any of them that I miss here.)
<!--T:15-->
'''.cache''' - Contains cached application files.  Keep an eye on this folder as sometimes application caches can grow over time.


<!--T:16-->
'''.config''' - This is where most modern applications keep user specific configuartion.  This is the first place you should look for application related configuration files.
Also, it is worth noting that any config files in this directory will have absolutely no effect if the program that they belong to is not installed on your machine. ''So orphan config files pose absolutely no danger''.
Also, it is worth noting that any config files in this directory will have absolutely no effect if the program that they belong to is not installed on your machine. ''So orphan config files pose absolutely no danger''.


'''.gimp-2.8''' - if you are a gimp user (version may differ).
<!--T:17-->
 
'''.local''' - Holds a user specific version of '''/usr/local'''.  Most notably application launchers can be found in '''.local/share/applications'''
'''.griffith''' - for those that use the griffith movie database.
 
'''.mozilla''' - for Firefox users, this is a really important one. I've found a little trick that can save you oodles of time:
 
You take the '''contents only''' of the
 
''~/.mozilla/firefox/<alphanumeric.code.defaults>/''
 
directory, (you will know it when you see it) & copy it over the top of the contents of the same location on the new installation.
 
It will have a '''different''' ''<alphanumeric.code>''
  which you must not change as it is the key
to this trick.
 
This will bring all of your Firefox settings including any & all of your add-ons/extensions & Bookmarks, to your new install or distro (it also works with BSD & Windows). Saving a LOT of work for some of us. Also copy over the ''~/.mozilla/firefox/profiles.ini'' replacing the original file in the new distro.
 
'''.themes''' - if you have a favourite or one that you have built or modified, then you most definitely want this folder.
 
'''.wallpaper''' - if you use feh to create a slideshow of your desktop backgrounds.
 
'''.worker''' - this holds the all important & oft laboured over ~/.worker/config file, which is one you never want to do twice.
 
'''.xbmc''' - if you are one who uses this software you will be wanting this important directory.
 
===Files:===
 
 
'''.Xdefaults''' - if you use the lal clock, or some other app needs this file then grab it. It doesn't exist on most systems.
 
'''.bash_profile''' - is worth bringing along for reference at least. I modify this file so that my machine boots straight to my Openbox desktop without needing to login. I've also modified my user search path using this file & set my user default Terminal editor here.
 
'''.bashrc''' - if you modify your .bashrc you won't let this one escape your attention. My .bashrc is a monster (in size that is).
 
'''.conkyrc''' - if you use conky & any other files or directories that you may have that are associated with your conky.
 
'''.fehbg''' - if you use feh for your desktop background.
 
'''.gtickrc''' - if you use the gtick metronome, it has your settings held here.
 
'''.mtpaint''' - holds the mtpaint user config.
 
'''.pypanelrc''' - for anyone using the pypanel, here's your config.
 
'''.stalonetrayrc''' - holds its config here.
 
'''.xinitrc''' - a very useful file for some of us, so it is worth keeping hold of as it is used to start a variety of things in conjunction with the startx command.
 
It is certainly useful for reference, but is not necessarily a good candidate to overwrite an existing .xinitrc that has been installed by a different distro, or the same distro that is using a different DE/WM. So be careful with what you do with this one.
 
===When changing distros:===


<!--T:18-->
'''.local/bin''' - Folder for your own scripts - included in your PATH


People often get into trouble due to their keeping their old /home partition for a couple of prime reasons.
<!--T:19-->
'''.mozilla''' - Configuration data for Firefox


* 1. Permission problems (if they are using a different user name for example).
<!--T:20-->
'''.thunderbird''' - Configuration and mailboxes for Thunderbird


* 2. They have a mixture of hidden <.dot> files from both distros in their ~/ partition.
<!--T:21-->
'''.ssh''' - ssh keys, known hosts and other per user ssh configuration


No 2. above may understandably set off warning bells with some readers. .xinitrc is the prime candidate to cause trouble. So heed the warning I attached to that one previously. .bashrc may sometimes have something specific to a distro that you may desire.  
<!--T:22-->
'''.steam''' - Data, config and game files for Valve's Steam platform


This is OK, because you can combine what you want from one .bashrc with another & customise to suit yourself. When in doubt merge the two of them. As you learn more about bash you may go in & strip out some duplication (it is harmless if it exists anyway).


The following files ''may sometimes'' have something that is either useful (you may want to use it) or more rarely something important:
<!--T:35-->
'''.gnupg''' - database for encrypting and signing using GnuPG - your private keys are here as well


.Xdefaults .Xresources .bash_profile .bashrc .conkyrc .xinitrc
==Files== <!--T:23-->


So if in doubt, don't overwrite these files in an installation of a different distro, or If you are using the same distro with a different DE/WM. Do a little research on anything you are unsure about.
<!--T:24-->
'''.bash_profile & .bashrc''' - Per user configuration for '''bash'''


<!--T:25-->
'''.xinitrc''' - If it is present in a user's home directory, startx and xinit execute it. Otherwise startx will run the default /etc/X11/xinit/xinitrc.


The Manjaro team have gone along way towards removing the above problems, (including the permission problem) as can be read here: [http://wiki.manjaro.org/index.php/Partitioning_Overview_and_Existing_Partition_Tables#Where_Using_an_Existing_Linux_Partition_Table]
<!--T:26-->
'''.zshrc''' - Per user configuration for '''zsh'''


'''Note:''' If you happen to have any important
hidden <.dot> files before you use the above
linked to Manjaro method; know that they will
be overwritten.


===Deleting ALL <.dot> directories/files from your ~/===
<!--T:36-->
'''.netrc''' - Configurations for accessing e.g. ftp servers


=Re-using /home= <!--T:27-->


With this in mind, my method (which is not distro specific) is to have all of the important hidden <.dot> files & directories backed up into a different directory in the /home partition (though off of the machine is the best policy). Then just prior to installing the new distro I delete all of the hidden <.dot> files using a very powerful bash command in the Terminal.
<!--T:28-->
People often get into trouble due to their keeping their old /home partition for a couple of prime reasons:


'''USE THE FOLLOWING VERY CAREFULLY, AS IT ''WILL DELETE'' ALL HIDDEN <.DOT> FILES INSIDE OF WHICHEVER DIRECTORY IT IS USED.'''


The following command will remove all of the hidden <.dot> files & directories from inside of the current directory:  
<!--T:29-->
:'''1.''' Permission problems (if they are using a different user name for example).


To be sure that you are in your ~/ directory,
<!--T:30-->
from inside of the Terminal '''hold down the'''
:'''2.''' They have a mixture of hidden <.dot> files from multiple distros in '''/home'''
'''''Shift'' key & then hit the ~ key''', found in
the top left area of your keyboard:
 
sudo rm –rf .??*
 
The option '''–rf''' & the use of '''.??*''' will delete all hidden files & directories.


The initial '''.''' indicates a hidden <.dot> file and the '''??''' match at least two characters to exclude the parent-directory which is '''..''' & to delete everything the '''<nowiki>*</nowiki>''' will match all alphanumeric characters that are used for naming directories & files.


<!--T:31-->
Before trying to re-use an existing '''/home''' be sure to review this section of the [[Partitioning_Overview_and_Existing_Partition_Tables#Where_Using_an_Existing_Linux_Partition_Table|Partioning Wiki Page]]


'''NOTE:''''' If you choose to do the above after running the '''su''' command, be sure that you are still in your '''~/''' directory. As if you have landed in /root you must change directory into your /home/<user.name> directory, or else you will delete all of the /root hidden <.dot> files & not those from ~/ your user home.''
<!--T:32-->
{{note|If you happen to have any important hidden <.dot> files before you use the above linked to Manjaro method; know that they will be overwritten.}}


==Feedback:==
<!--T:33-->
When coping <.dot> files from one '''/home''' to another, it is important to be selective, especially when doing so between different distros or different versions of the same distro.  For example, it is unwise to copy an entire '''~/.config''' over but perfectly safe to bring over many of the files within it on an application by application basis.


If you find any problems, room for improvement or whatever, please post in this thread in the Manjaro forum: [http://forum.manjaro.org/index.php?topic=2673.msg21752#msg21752]
</translate>
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 09:14, 25 December 2021

Other languages:
English • ‎Türkçe • ‎русский

What's a hidden <.dot> file?

They are files & directories with a "." dot in front of them. Placing a "." dot in front of a file or directory tells the operating system that such files & directories are to be hidden from view in file managers, file requesters & such. File managers & other applications can usually be set to view these normally hidden files. These hidden files & directories usually contain configuration files of some sort.

These hidden files will be referred to as <.dot> files in this article.


Why is it worth knowing about these <.dot> files?

  • These files contain settings/configuration information that will often need to be modified
  • It is well worthwhile knowing which <.dot> directories & files in your ~/ directory are valuable in saving you time & effort if you have to reinstall Manjaro due to a hardware failure, corrupt data, user error...
  • If you are coming from, or going to another distro, this can be extremely valuable knowledge. As again, these <.dot> files can save you an enormous amount of time & effort in configuring your system to be just the way you like it. More on this to come.
  • This knowledge can also be used to backup important config files, some of which can have had many, many hours of work in them.


So, what do these <.dot> files in my /home do?

Note
<.dot> files are hidden by default. You usually need to enable them in your file manager or by using ls -A

Looking in your ~ directory can identify any folders that have configuration or other customised data for our system, including the DE/WM and applications.

Some examples of these are; panels, trays, clocks, text editors, image viewers, pdf viewers & other applications. A quick look in your ~/.config directory will make this clear.

A reference to key <.dot> files

The following represent some of the most common types of <.dot> files that are found directly in your home folder. This is not an extensive list but represents some of the most common items.

Whether the files are important or not cannot be judged in this article - it depends on how much time you have spent on customizing your configuration files. Some window managers can only be configured using these files - in that case they become important. Or you have a collection of scripts in ~/.local/bin - they have become important as they - often - represent a great amount of work.

Directories

.cache - Contains cached application files. Keep an eye on this folder as sometimes application caches can grow over time.

.config - This is where most modern applications keep user specific configuartion. This is the first place you should look for application related configuration files. Also, it is worth noting that any config files in this directory will have absolutely no effect if the program that they belong to is not installed on your machine. So orphan config files pose absolutely no danger.

.local - Holds a user specific version of /usr/local. Most notably application launchers can be found in .local/share/applications

.local/bin - Folder for your own scripts - included in your PATH

.mozilla - Configuration data for Firefox

.thunderbird - Configuration and mailboxes for Thunderbird

.ssh - ssh keys, known hosts and other per user ssh configuration

.steam - Data, config and game files for Valve's Steam platform


.gnupg - database for encrypting and signing using GnuPG - your private keys are here as well

Files

.bash_profile & .bashrc - Per user configuration for bash

.xinitrc - If it is present in a user's home directory, startx and xinit execute it. Otherwise startx will run the default /etc/X11/xinit/xinitrc.

.zshrc - Per user configuration for zsh


.netrc - Configurations for accessing e.g. ftp servers

Re-using /home

People often get into trouble due to their keeping their old /home partition for a couple of prime reasons:


1. Permission problems (if they are using a different user name for example).
2. They have a mixture of hidden <.dot> files from multiple distros in /home


Before trying to re-use an existing /home be sure to review this section of the Partioning Wiki Page


Note
If you happen to have any important hidden <.dot> files before you use the above linked to Manjaro method; know that they will be overwritten.

When coping <.dot> files from one /home to another, it is important to be selective, especially when doing so between different distros or different versions of the same distro. For example, it is unwise to copy an entire ~/.config over but perfectly safe to bring over many of the files within it on an application by application basis.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.