Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My incredibly tech smart girlfriend took control of the cockpit and closed (like in close arrow) my virtual machine running Ubuntu 12.10. When I restarted, my 'Documents' folder in 'Home' was missing.

How do I recover it?

Thank you

share|improve this question

Ok, found it. :

To create a new Documents folder

Open home folder > right click > new folder. Name it Documents

If the icon is incorrect then right click on the new Documents folder > properties. Click on the folder icon, this will bring up a select custom icon window.

Browse to File System > usr > share > icons > Humanity > places > 48 & select the 1st folder_documents.svg. This should restore the icon to your Downloads folder

Then gedit ~/.config/user-dirs.dirs or browse to file. You'll see this line -


edit it to this & save. Then log out/in

share|improve this answer

How does this work?

The "special" directories in home (e.g. Documents, Music, etc.) are updated early in the login process by a program called xdg-user-dirs-update. If $XDG_CONFIG_HOME/user-dirs.dir (by default this is the same as ~/.config/user-dirs.dir) is present it uses this to set the directories. The content of this file should look something like this:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.

Why did it disappear?

Within a user session, if one of these directories is deleted and recreated it will be picked up automatically. However, if you remove the target location of $XDG_DOCUMENTS_DIR (like in this question) and reboot (or, presumably, logout), the program will assume you don't want to use it any more and reset the target to "$HOME/", effectively disabling it.

How do I get it back?

Simply re-setting the relevant value back to your chosen location in this file should return everything back to normal.

In this case, that means using your text editor of choice to change




Of course, the Documents/ directory (or whatever you choose) should be present if you don't want to go through this process again ;) The change should be picked up by the file manager as soon as you open a new window, there's no need to restart or logout (it doesn't appear to be picked up straight away by the Unity launcher, though).

Alternatively, you can use the command line:

$ xdg-user-dirs-update --set DOCUMENTS "$HOME/Documents"

Just for completeness, you can fetch the PATH for a particular "special" location with:

$ xdg-user-dir DOCUMENTS

Enter man xdg-user-dir for the list of XDG user dir names, though they should be obvious from the file content pasted above.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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