3

I have a simple problem: Whenever I delete the templates folder in my home directory (/home/[username]/ in case that info is of use) it seems to come back. It contains nothing and I have no use for it. Is there a way to make it go away permanently?

  • What version of Ubuntu are you using? I've just deleted my Templates directory and restarted - it's not come back. – Carl H May 6 '15 at 18:27
  • They can come back, depending on your configuration/desktop environment. They're called "XDG user directories". I have no time to delve into it now, but you can search starting from man xdg-user-dirs-update – Rmano May 6 '15 at 18:32
  • 2
    Run ` sed -i.bak 's/^XDG_TEMPLATES_DIR/#&/' ~/.config/user-dirs.dirs` and then remove it.....now restart and check.. – heemayl May 6 '15 at 18:35
  • I'm on 12.04, why? – It's Willem May 7 '15 at 17:39
  • Add a tag with your Ubuntu version – A.B. May 7 '15 at 17:39
3

In your home folder is a configuration file ~/.config/user-dirs.dirs:

nano ~/.config/user-dirs.dirs

with a content like this:

[..]
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
[..]

You can comment out the line by which the folder will automatically create:

before:

XDG_TEMPLATES_DIR="$HOME/Templates"

after

#XDG_TEMPLATES_DIR="$HOME/Templates"

Or you can use a single command in a terminal:

sed -i.bak 's/^\(XDG_TEMPLATES_DIR=\)/#\1/' ~/.config/user-dirs.dirs

This can be undone:

sed -i.bak 's/^#\(XDG_TEMPLATES_DIR=\)/\1/' ~/.config/user-dirs.dirs

In both cases, a backup of your file will be created:

~/.config/user-dirs.dirs.bak
  • I went into the .config directory and there was no user-dirs.dirs – It's Willem May 7 '15 at 17:39
  • @It'sWillem open terminal: file .config/user-dirs.dirs what output you get for this? – Edward Torvalds May 7 '15 at 17:45
  • An empty text file named user-dirs.dirs – It's Willem May 7 '15 at 18:16
  • It returned a "No such file" message – It's Willem May 8 '15 at 0:36

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.