I want to move Template directory out from my ~ home folder. I would like to have one global Template directory. One option, that I think can be possible is to create a link(shortcut or how is it called in linux) to Template, but then Template file would still be in my folder and I don't know where to put global Template folder, where is a place, that should be used by it (maybe /opt?). So basically:

  • Is it possible to create one global Template folder instead of Template for every user? And how? (by one, I mean, that I'm able to remove Template folder from every user).

If not:

  • Where should I put a folder with templates, where is a good place for putting my global configurations in linux?

EDIT: I checked and put my global Templates folder in /opt/Template, then I made a link from every user account to that place and it works fine, but still I have no idea, if it is possible to get rid of Template folder (or link) completely in user's home folders.

1 Answer 1


enter image description here

It is indeed possible to create a global template folder as the picture shows.

To do this you can edit the file ~/.config/user-dirs.dirs

Change the line XDG_TEMPLATES_DIR="$HOME/Templates" to XDG_TEMPLATES_DIR="/opt/Templates" if your global folder is in /opt/Templates

Note 1 - you should consider carefully the permissions you give this template folder. I would suggest you should give read-only rights with a common group shared by those users of a client. Obviously try to avoid 777 rights to this folder since this makes the folder read-writable to everyone and anyone.

Note 2 - the XDG_TEMPLATES_DIR folder needs to be EITHER a folder locate in the users home or an absolute folder (full path to the folder starting with /)

Note 3 - you dont necessarily need to modify user-dirs.dirs. You could remove the local home-folder and soft-link it to your global templates folder i.e.

cd ~/
rmdir Templates
ln -s /opt/Templates Templates

Note 4 - logout and login for changes to take effect

  • great. For an opt and Templates I made 755, for files inside Templates I made 744. Everything works perfectly. Do I need to change user-dirs,dir or soft-link folder every time I create a new user? Or is there any way to automate this process?
    – Benjamin
    Jul 2, 2012 at 22:37
  • 2
    @Benjamin - according to this Q&A - you need to put your modified .config/user-dirs.dirs into /etc/skel - there are some very useful links in the accepted answer as to how to customise new user accounts. askubuntu.com/questions/83532/…
    – fossfreedom
    Jul 2, 2012 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.