Frequently Asked Question
Why are some files hidden, and what is the dot-file convention?
A file whose name starts with a dot, .bashrc, .config, .git, is hidden by
convention: ls skips it unless you pass -a. The convention was an accident. When
. and .. were added to every directory, the author of ls wanted a quick way to
skip those two entries, and the cheapest test was "starts with a dot". The side
effect of hiding any other dot-prefixed file turned out to be useful, and within a
few years it had become the standard place for per-user configuration.
Today your home directory is full of dotfiles: shell startup (.bashrc,
.profile), editor configuration (.vimrc), git settings (.gitconfig), SSH keys
(.ssh/), application caches and state. The XDG Base Directory Specification tries
to herd new applications into ~/.config/, ~/.local/share/, and ~/.cache/ rather
than scattering dotfiles across $HOME, but legacy programs still litter the home
directory. To act on hidden files in a script, use ls -A (which omits . and ..)
or enable shopt -s dotglob so that * matches them.