XDG/EnvVar/XDG_CONFIG_HOME
XDG_CONFIG_HOMEis an environment variable defined by the XDG Base Directory Specification. It tells applications where to store user-specific configuration files.Default behavior
- If
XDG_CONFIG_HOMEis not set, programs fall back to: Why it exists
The XDG spec standardizes where apps put:- config files
- data files
- cache files
Instead of cluttering$HOMEwith dotfiles like:~/.tmux.conf ~/.gitconfig ~/.config ~/.somethingelse
apps can use:~/.config/<app>/
This makes configuration: - more organized
- easier to back up
- easier to redirect (e.g., in containers or custom setups)
How to check yours
echo $XDG_CONFIG_HOME
If it prints nothing, it means you’re using the default~/.config.