What is xdg_config_home
Last updated: April 1, 2026
Key Facts
- XDG_CONFIG_HOME defines the base directory for user configuration files on Linux and Unix systems
- The default value is ~/.config (the .config folder in the user's home directory) when the variable is not set
- It is part of the XDG Base Directory specification established by freedesktop.org
- Applications should store configuration files in subdirectories named after the application within XDG_CONFIG_HOME
- This standardization allows users to manage and backup configuration files more easily across different applications
Overview
XDG_CONFIG_HOME is an environment variable that establishes a standard location for user configuration files on Linux and Unix systems. Defined by the XDG Base Directory specification, it provides a consistent approach for applications to store their settings and preferences, moving away from the historical practice of scattering configuration files throughout the home directory.
Default Location
If XDG_CONFIG_HOME is not explicitly set in the environment, applications should default to ~/.config as the configuration base directory. This means configuration files would be stored in a hidden .config folder within the user's home directory. Many modern applications follow this convention even on systems that don't explicitly set the variable.
Directory Structure
Applications are expected to organize their configuration files within subdirectories named after the application. For example, the GNOME Terminal application stores its configuration in ~/.config/gnome-terminal/, while the Firefox browser uses ~/.config/firefox/. This hierarchical structure keeps the configuration directory organized and prevents file name conflicts between different applications.
Advantages of XDG Standardization
- Organization: Configuration files are centralized in one location rather than scattered throughout the home directory
- Backup and Migration: Users can easily backup or migrate configuration by copying the .config directory
- Consistency: Developers follow a common standard, making the system more predictable
- Management: Tools can be written to manage or clean up configurations consistently
- Cross-Platform: Similar implementations exist on other systems, improving portability
Usage and Implementation
When developing applications, developers should check for the XDG_CONFIG_HOME environment variable and use it as the base path for configuration files. If the variable is not set, the application should default to ~/.config. This ensures compliance with the XDG specification and provides users with a familiar, organized file structure.
Related XDG Variables
XDG_CONFIG_HOME is part of a broader set of XDG Base Directory variables. XDG_DATA_HOME specifies where application data should be stored, XDG_CACHE_HOME defines the cache directory, and XDG_RUNTIME_DIR specifies runtime file locations. Together, these variables create a comprehensive standard for organizing user-specific files.
Related Questions
What is the difference between XDG_CONFIG_HOME and XDG_DATA_HOME?
XDG_CONFIG_HOME stores user-editable configuration and settings files, while XDG_DATA_HOME stores application-generated data, cache, and resources. Config files are typically human-readable settings, while data files are application state and content.
How do you find an application's configuration files?
Look in ~/.config/[application-name]/ by default. You can also check the XDG_CONFIG_HOME environment variable by running 'echo $XDG_CONFIG_HOME' in the terminal to see the actual configured location.
Can you customize where configuration files are stored?
Yes, you can set the XDG_CONFIG_HOME environment variable to any directory you prefer. Add 'export XDG_CONFIG_HOME=/your/custom/path' to your shell configuration file.
More What Is in Daily Life
- What Is a Credit ScoreA credit score is a three-digit number, typically ranging from 300 to 850, that represents your cred…
- What Is CD rates make no sense based on length of time invested. Explain like I'm 5CD (Certificate of Deposit) rates often don't increase with longer lock-up times the way people expe…
- What is a phdA PhD (Doctor of Philosophy) is a doctoral degree earned after completing advanced academic research…
- What is a polymathA polymath is a person with deep knowledge and expertise across multiple different fields or academi…
- What is aaveAAVE stands for African American Vernacular English, a dialect with distinct grammar, pronunciation,…
- What is aarch64ARMv8-A (commonly called ARM64 or AArch64) is a 64-bit processor architecture developed by ARM Holdi…
- What is about menTopics and discussions about men typically encompass masculinity, male identity, gender roles, men's…
- What is abiturAbitur is the German academic qualification awarded upon completion of secondary education, typicall…
- What is abrosexualAbrosexual is a sexual orientation identity where a person's sexual attraction changes or fluctuates…
- What is abgABG is an Indonesian acronym standing for 'Anak Baru Gede,' which refers to adolescent girls or teen…
- What is aaaAAA batteries are a standard cylindrical battery size measuring 10.5mm in diameter and 44.5mm in len…
- What is aacAAC (Advanced Audio Codec) is a digital audio compression format that provides better sound quality …
- What is aaa gameAAA games are high-budget video games developed by large studios with budgets typically exceeding $1…
- What is a proxyA proxy is a server that acts as an intermediary between your device and the internet, forwarding yo…
- What is ableismAbleism is discrimination and prejudice against people with disabilities based on the assumption tha…
- What is absAbs, short for abdominal muscles, are the muscles in your core that flex your spine and stabilize yo…
- What is abortionAbortion is a medical procedure that ends pregnancy by removing the fetus before viability. It can b…
- What is accutaneAccutane (isotretinoin) is a powerful prescription medication derived from vitamin A used to treat s…
- What is acetaminophenAcetaminophen, also known as paracetamol, is an over-the-counter pain reliever and fever reducer use…
- What is acidAcid is a chemical substance that donates protons (hydrogen ions) to other substances, characterized…
Also in Daily Life
- How To Save Money
- Why are so many white supremacist and right wings grifters not white
- Does "I'm 20 out" mean youre 20 minutes away from where you left, or youre 20 minutes away from your destination
- Why are so many men convinced that they are ugly
- What does awol mean
- What does asl mean
- What does ad mean
- What does asap mean
- What does apex mean
- What does asmr stand for
- What does atp mean
- What causes autism
- What does abg mean
- What does am and pm mean
- What does a fox sound like
More "What Is" Questions
Trending on WhatAnswer
Browse by Topic
Browse by Question Type
Sources
- XDG Base Directory Specification CC0-1.0
- Wikipedia - XDG Base Directory CC-BY-SA-4.0