Glossary

Dotfile

A dotfile is a file whose name begins with a .. By convention, tools like ls hide such files unless given the -a flag, which provides a lightweight way for programs to store configuration in a user's home directory without cluttering the view. ~/.bashrc, ~/.profile, ~/.vimrc, ~/.ssh/, ~/.config/, ~/.gitconfig—nearly every program you use has its preferences tucked away in dotfiles.

The hidden status of dotfiles is a happy accident. In early Unix, ls was modified to skip the . and .. directory entries, and the fastest implementation simply skipped any name starting with a dot. Developers realised they could hide configuration files the same way, and the convention stuck.

Power users often maintain their dotfiles in a git repository, so their environment follows them from machine to machine:

git clone https://github.com/user/dotfiles ~/.dotfiles
cd ~/.dotfiles && ./install.sh

Tools like GNU Stow, chezmoi, and yadm help manage dotfiles across machines, handling host-specific overrides, secrets, and symlinks. A well-tended dotfile repository is one of the most portable pieces of personal infrastructure a Linux user can own.

Related terms: /home

Discussed in:

Also defined in: Textbook of Linux