2

My home folder disappeared all of a sudden (Desktop, Downloads, Documents ... all deleted) and now my system considers my Desktop as the home directory. Is there any way to recover my old Desktop, Downloads ...

Update:

$ cat ~/.config/user-dirs.dirs

# 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.
# 
XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/"
XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/"  
2
  • All i want for the moment is to recover my Desktop – Youssef Ilyès Mar 18 '16 at 10:50
  • OK I see the issue and in my formal answer I have posted a fix, hopefully this will set you on the right path :) – andrew.46 Mar 18 '16 at 10:59
2

To return all to the defaults and recover your Desktop run the following single command in a Terminal window and then reboot:

xdg-user-dirs-update --set DESKTOP "$HOME/Desktop" && \
xdg-user-dirs-update --set DOWNLOAD "$HOME/Downloads" && \
xdg-user-dirs-update --set TEMPLATES "$HOME/Templates" && \
xdg-user-dirs-update --set PUBLICSHARE "$HOME/Public" && \
xdg-user-dirs-update --set DOCUMENTS "$HOME/Documents" && \
xdg-user-dirs-update --set MUSIC "$HOME/Music" && \
xdg-user-dirs-update --set PICTURES "$HOME/Pictures" && \
xdg-user-dirs-update --set VIDEOS "$HOME/Videos"

If you wish to weed out some of these you can do so judiciously by using the xdg-user-dirs-update as detailed above...

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.