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


sr #108134: Use XDG dirs instead of $HOME

Submitted by:  Oliver Propst <oliverp>
Submitted on:  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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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 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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 450 encouragements so far.

    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.7