XDG_DATA_HOME
also: XDG specification, XDG base directory
An environment variable that specifies the base directory where applications store user-specific data files, defaulting to ~/.local/share if unset.
XDG_DATA_HOME is part of the XDG Base Directory Specification, a standard that defines where Linux applications should store user data. When set, it tells applications where to write persistent, non-configuration data like caches, recently-used files, or application databases.
If the variable is not explicitly set, applications default to ~/.local/share. For example, GIMP stores brushes in $XDG_DATA_HOME/gimp, and many applications keep their data organized in subdirectories matching their name.
This standardization helps keep home directories clean and organized by separating configuration files (XDG_CONFIG_HOME), data (XDG_DATA_HOME), and cache (XDG_CACHE_HOME) into distinct locations rather than scattering dotfiles everywhere.