Ubuntu: Recreate “Desktop” directory


I accidentally deleted ~/Desktop. This directory plays some kind of important role because now that it is gone all of the folders under ~/ are showing up on my accounts desktop. How do I fix this?


Press Ctrl+Alt+T to go to a terminal and type:

mkdir ~/Desktop  

and then press F5 on the desktop to refresh it.


First you should create the directory again:

mkdir ~/Desktop  

Now if the default icon has not appear then you should edit ~/.config/user-dirs.dirs file.

gedit ~/.config/user-dirs.dirs  

It should be same as 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.  #   XDG_DESKTOP_DIR="$HOME/Desktop"  XDG_DOWNLOAD_DIR="$HOME/Downloads"  XDG_TEMPLATES_DIR="$HOME/Templates"  XDG_PUBLICSHARE_DIR="$HOME/Public"  XDG_DOCUMENTS_DIR="$HOME/Documents"  XDG_MUSIC_DIR="$HOME/"  XDG_PICTURES_DIR="$HOME/Pictures"  XDG_VIDEOS_DIR="$HOME/Videos"  

Take a look over this for more information

NB: you may need to have a restart or logout and then login to apply the new settings

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »