9

I accidentally deleted 'Documents' folder and all its contents in Home folder, is there any step by step way to recover or at least recreate an empty original 'Documents' folder again? I'm using ubuntu 12.04 by the way.

3 Answers 3

17

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 - XDG_DOCUMENTS_DIR="$HOME/"

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

XDG_DOCUMENTS_DIR="$HOME/Documents"

3
  • 2
    If the answer helped you, please select the answer as the correct answer, that way both of you get points. Jan 10, 2013 at 5:51
  • No need to manually add the icons. Editing user-dirs.dirs with the correct paths should do that for you. This should be accepted. Worked great!
    – TheBat
    Oct 23, 2016 at 3:42
  • 1
    For a more straightforward solution, see also unix.stackexchange.com/a/606950/19643 Aug 29, 2020 at 14:26
0

extundelete Install extundelete

This command line tool tries to undelete files from a hard drive. Due to the way /ext4 handles file detetions there is a high risk to loose recoverable files when there was a subsequent write access to the drive.

It is therefore strongly advisable to immediately unmount the drive (or mount it as read only) before we start recovery. As a system partition can not be unmounted during runtime we need to perform all recovery actions from a live CD session (boot from CD/USB to choose "Try out Ubuntu").

We then may install extundelete (which can be also done from a live session) and run:

sudo extundelete --restore-directory /home/<user>/Documents/ /dev/<sdxX>

Replace <user> by your username and <sdxX> by the partition your HOME resides.

See also: Extundelete User Manual

3
  • How do we unmount a drive?! Feb 1, 2016 at 10:10
  • @VineetKaushik: umount or don't mount it when in a live session.
    – Takkat
    Feb 1, 2016 at 10:20
  • How to know which drive my home is? <sdxx> Jun 24, 2016 at 0:10
0

have you try PhotoRec(PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from hard disks, CD-ROMs ) ?

here some turtorial video

http://www.youtube.com/watch?v=QGAgpl77Vmc

http://www.youtube.com/watch?v=EJdx2ORi3r4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .