XDG Base Directory
also: XDG, XDG Base Directory Specification
A freedesktop.org specification that defines standard locations for user configuration, cache, and data files in Linux, reducing clutter in the home directory by organizing application files into dedicated subdirectories.
The XDG Base Directory specification establishes a consistent convention for where applications should store their files. Instead of scattering dotfiles and directories throughout the home folder, XDG defines several standard locations: ~/.config for configuration files, ~/.cache for temporary data, ~/.local/share for application data, and others.
For example, instead of a program creating ~/.myapp, it should place its config in ~/.config/myapp/config.txt and cached data in ~/.cache/myapp/. This makes the home directory cleaner and helps users find settings more predictably.
Applications check environment variables like $XDG_CONFIG_HOME, $XDG_CACHE_HOME, and $XDG_DATA_HOME (which default to the standard paths) to determine where to store files. Modern Linux applications increasingly adopt this standard, though many legacy programs still use their own conventions.