helpThe GNU Bourne-Again SHell - Support: sr #108134, Use XDG dirs instead of $HOME


sr #108134: Use XDG dirs instead of $HOME

Submitter:  Oliver Propst <oliverp>
Submitted:  Sun 16 Sep 2012 11:11:47 AM UTC
Votes:  450  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Wont Do
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Sat 27 Aug 2022 07:36:27 PM UTC, comment #8: 

Hello, I'd like this feature too (supporting moving configuration files to a user-specified directory). My goal is to organize my home directory and centralize all user configuration in a single directory that's not hidden (doesn't start with a dot). I expect to reduce my home directory by almost 70 files and keep only 2 dozen directories in it, none of them being hidden files.

Wed 17 Aug 2022 09:44:39 PM UTC, comment #7: 

1. Here's my two cents. Hosting or version controlling configuration files becomes dead simple when everything is in XDG_CONFIG_HOME. No symlink hell. Oh, and easy to omit cache that isn't essential when it's time for backups / disk cleaning.

2. I'm compelled to argue towards the opposite. Not following this standard will continue to create edge-cases that have to be accounted for by every user that attempts to interact with bash but knows about the XDG base directory spec.

gabrielhansson <gibbz>
Mon 25 Jul 2022 02:22:54 PM UTC, comment #6: 

Because someone has to add that support, which leads to two reasons:

1. No one has ever been able to articulate a compelling reason
   for adding this that doesn't ultimately come down to circular
   reasoning; and

2. It adds technical debt that has to be carried.

Chet Ramey <chet>
Project Administrator
Sat 23 Jul 2022 01:13:25 PM UTC, comment #5: 

What about just adding support for it, simply add an option to enable support for XDG dirs.

BWKC <bwkc>
Wed 12 Oct 2016 03:25:05 AM UTC, comment #4: 

The Bourne-Again Shell is sadly one of the few software tools still not implementing the  XDG Base Directory Specification:

Chris <cseelus>
Fri 13 Nov 2015 02:36:20 AM UTC, comment #3: 

There's no reason to change historical behavior here.  All the world is not Linux.

Chet Ramey <chet>
Project Administrator
Sat 05 Jan 2013 09:24:33 AM UTC, comment #2: 

According to XDG Base directory specification,
user preferences should go into $XDG_CONFIG_HOME (which default to ~/.config)
and cached data should go to $XDG_CACHE_HOME (which default to ~/.cache).
More details at :

Full specification can be found at:

The XDG base directory specification have good de facto adoption.
It has been adopted by:
- GNOME ( )
- GTK+ ( )
- KDE ( )
- QT ( )
- XFCE ( in Files and Environment Variables )
- Razor-qt
- VLC ( )
- GStreamer ( )
- Chrome ( )
- many more upstream applications
- Ubuntu ( & )
- Debian ( )
- Red Hat
- Fedora
- Suse
- many more distributions

I think that bash should use same locations than the vast majority of Desktop environment and applications.

There are real advantages of following this specification :
- a lot less cluttered $HOME
- Make backups a lot more safer and easier.
  Backuping your $XDG_DATA_HOME along with your files is enough
  (or just excluding $XDG_CACHE_HOME)
- A lot easier to reset a default configuration if you want/need it (and
  without any risk to loose informations). Even for the software itself
  could choose to reset $XDG_CONFIG_HOME if needed.
- Avoid some strange bugs that happens because you had a old version of
  some configuration file
- A lot more of flexibility and portability because no path are hardcoded.

Eric Heintzmann <eheintzmann>
Wed 21 Nov 2012 12:32:53 PM UTC, comment #1: 
  • ping
FaisPas <faispasierch>
Sun 16 Sep 2012 11:11:47 AM UTC, original submission:  

Bash stores ~/.bash_aliases , ~/.bash_history, ~/.bash_logout and ~/.bashrc in the home directory. It would be better to store these files according to the XDG Base Directory Specification.

Oliver Propst <oliverp>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gibbz (Posted a comment)
  • -email is unavailable- added by bwkc (Posted a comment)
  • -email is unavailable- added by whenov (Voted in favor of this item)
  • -email is unavailable- added by dfrankcom (Voted in favor of this item)
  • -email is unavailable- added by k41eb (Voted in favor of this item)
  • -email is unavailable- added by hannavasung
  • -email is unavailable- added by adrianheine (Voted in favor of this item)
  • -email is unavailable- added by cseelus (Posted a comment)
  • -email is unavailable- added by cseelus (Voted in favor of this item)
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by eheintzmann (Posted a comment)
  • -email is unavailable- added by faispasierch (Posted a comment)
  • -email is unavailable- added by oliverp (Submitted the item)

    There are 450 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-24 whenov Carbon-Copy- Added whenov
    2020-09-12 dfrankcom Carbon-Copy- Added dfrankcom
    2019-12-08 k41eb Carbon-Copy- Added k41eb
    2017-09-19 hannavasung Carbon-Copy- Added hannavasung
    2017-02-08 adrianheine Carbon-Copy- Added adrianheine
    2016-10-12 cseelus Carbon-Copy- Added cseelus
    2015-11-13 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.9