Dotfiles
Files prefixed with a dot .
are called dotfiles. They are hidden by default
on Unix-based operating systems. Dotfiles are used to store any type of
configuration. All the user configuration is stored in dotfiles somewhere in or
under the home directory. A lot of applications store their
configuration in the ~/.config/
directory.
It is recommended to make a Git repository to back up and sync
configuration files. However, it is not recommended to make a Git repository
directly in the home directory. A better alternative is to move configuration
files into a separate directory like ~/dotfiles/
. To make sure installed
programs still have access to the configuration files,
symbolic links to the configuration files can be made using
Stow.
History
That dotfiles are invisible was an accident1. A long time ago Unix decided
to hide the .
and ..
directories because they exist in every directory. The
implementation only checked if the first character of a file or directory name
was a dot .
, and hid it when that was the case:
if fileName[0] == "." {
hideFile()
}
This results in every file and directory starting with a dot to be hidden. What
they should have done is check if the filename is .
or ..
instead:
if fileName == "." || fileName == ".." {
hideFile()
}