4

I accidentally deleted some large files (10gb which is associated with Truecrypt) but I didnt empty the trash. It is inside the trash, when I run BleachBit I see them but I can't recover those files from the trash.

Trash looks empty, 'Restore selected items' looks faded and 'Empty trash' looks highlighted. But I didn't empty it. When I delete other files they disappear but they don't show inside the trash bin.

Zanna
  • 70,465
robin
  • 41
  • use ext4magic to recover files from specific folder you deleted. Command "ext4magic /dev/sdaX -H -x -f /home/Path to your folder" to list number of files deleted. Command "sudo ext4magic /dev/sdaX -H -a 1631XXXX -b 1631XXXXX" to short list number of files deleted to closer to specific time. Command "sudo ext4magic /dev/sdaX -a 1631XXXXX -f /home/Your folder to recover -m -r -d /target output folder path" – Ajay Nov 24 '21 at 12:12
  • Make sure to not have files or folders with the same name because it won't have a place to put the folder or file once restored and simply just crashes. – K065 Nov 24 '21 at 01:32

3 Answers3

12

Normally you'd left-click on the trashcan icon, select the file you want to restore, and click on 'Restore selected items'.

If that's not working for you, try this:

  • Open a terminal (ctrl-alt-t) Type this to go to the trash directory:

    cd .local/share/Trash/files
    
  • To see the files in the trash directory type:

    ls
    
  • If you see the file you need to restore, use the mv command to move it elsewhere in the filesystem:

    mv my-large-file.tc ~/Desktop
    
    • If the file has a strange name you can use quotes around it, like this:

      mv "1940's hits (rock)" ~/Desktop
      

    Alternatively, type mv, then the first characters of the filename (for example, 1940), then press the TAB key to get filename autocompletion, which will take care of adding necessary quoting automatically. If the generated filename has characters like \, it's OK, those are for quoting special characters.

Seth
  • 58,122
roadmr
  • 34,222
  • 9
  • 81
  • 93
  • It works but not for every file. For example when I type ls a directory name appears as "1940's Hit Songs (4 of 4) USA" and mv command doesn't recognise this file name. But it works with a file name like "alfa.zip" etc. – robin Jan 14 '12 at 16:44
3

I had the same problem and roadmr's solution didn't work for me either. Then I realized that my files were from USB. When you delete the files on some other media (e.g. USB) it does NOT go to .local/share/Trash but it goes to .Trash* directory on that device.

For example, my USB was mounted on /media/DA6B-3E12 and the files were on: /media/DA6B-3E12/.Trash-1000/files.

You can now use the mv command to restore them.

mv /media/DA6B-3E12/.Trash-1000/files/your_song.mp3 ~/Desktop
Seth
  • 58,122
zuwhan
  • 31
0

I had a slightly different problem - the deleted folder was shown in trash but clicking restore just caused the window to hang with the restore button still visible and not greyed out. After about 30 seconds a dialog appeared saying "files is not responding".

I left it a few minutes and still nothing happened so eventually I just killed the process and restarted it. As far as I can tell my files have been restored OK

Andy
  • 253