125

For as long as I can remember, every time I install Ubuntu there is a folder in the home directory called "Templates." I've always just deleted it, but I'm curious: what's it supposed to be used for, and why is it in the default install?

1
  • 3
    Great question. I've always done the same thing, deleting the folder after installing. I think @fossfreedom just made our lives a little bit easier. Jan 12, 2012 at 17:20

1 Answer 1

182

If you drop any files in this folder, for example

enter image description here

then when you right-click and create a new document, you can select any of these files as a basis for the new file - i.e. a template.

enter image description here

For as long as I remember, this has always been a standard feature on many desktops such as Gnome.


If you have deleted the folder and need to restore this functionality:

gedit ~/.config/user-dirs.dirs

Check that there is a line containing the following - if not, add this line.

XDG_TEMPLATES_DIR="$HOME/Templates"
7
  • 22
    You just answered hours of questions.
    – BenjaminRH
    Apr 18, 2012 at 17:00
  • So does this play well with OpenDocument templates, eg .ott files and the like?
    – jdpipe
    Jun 7, 2016 at 12:52
  • Does freedesktop specify the list of "well known" directories and what they should do somewhere, or is the xdg-user-dir implementation all we get? freedesktop.org/wiki/Software/xdg-user-dirs Dec 10, 2016 at 12:11
  • Thanks, This works great on ext4 mounts but on filesystem types fuse or cifs mounts (i.e. network drives and local ntfs drives) the executable flag gets set automatically upon creation of the file. How can I inhibit this? Jan 28, 2021 at 10:06
  • @Mark, your link doesn't work. I point here to your other answer askubuntu.com/a/652664/15943
    – alfC
    Jul 22, 2021 at 3:10

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.