By accident I've removed some folders (they were empty) in my home folder. I've created a new ones but they doesn't have proper icons etc... how can I recreate them step by step?

  • Instead of creating folders, just logout/login. – mikewhatever Dec 11 '11 at 20:09
  • Systemfiles in your home get recreated if they are missing when you start a new login! So remove the files you added yourself. – Rinzwind Dec 11 '11 at 20:13
  • unfortunately didn't help...I removed my icons, but the new ones didn,t appear...after relogin and even after restart – Patryk Dec 11 '11 at 20:19

OK, to restore deleted directories

edit ~/.config/user-dirs.dirs ,

gedit ~/.config/user-dirs.dirs

it should look 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.

If that fails, install and run Ubuntu Tweak


Screen Shot

  • Absolutely Perfect. – x__x Sep 4 '15 at 14:25
  • This helped me greatly. I mistakenly deleted, and restoring did the trick. Thank you sir! – Mookey Jul 8 '16 at 11:28

First, stop using your system from the hard drive ASAP. You will need to boot a live CD and try recovery from there.

I have had mixed, generally poor results with the ext4 file system, but try , in order, testdisk and then photorec. Both are in the repositories and both can be installed in the live session

sudo apt-get update
sudo apt-get install testdisk

You then run testdisk from the command line

# you might be able to run it as a user, but I would run it as root
sudo testdisk

There is a step-by-step tutorial , with screen shots, here


If that fails, try photorec.

Photorec is a part of the testdisk package, again there is a detailed walk through here


If that fails, you can try extundelete


Last time I tried that, it did not recover my files.

Good luck.

  • Well I don't want to recover any files because they didn't exist in my folders. Folders were empty. I just want to recreate home folders like images, videos etc... – Patryk Dec 11 '11 at 20:26
  • What directories (folders) ? – Panther Dec 11 '11 at 20:27
  • When You open Your home folder You can see folders like Documents, Images, Videos etc... and I mean these folders. I've deleted them and I want to recreate them with proper icons for each. – Patryk Dec 11 '11 at 20:31
  • I added an answer, I thought from my read you were in the data recovery mode , sorry – Panther Dec 11 '11 at 20:38
  • The first method didn't worked, terminal gave me some errors about missing files during saving user-dirs.dirs, but ubuntu tweak worked. Thank You! – Patryk Dec 11 '11 at 20:58

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.