(L)Ubuntu 14.04 Quick Un-Erase / Un-Delete Tip

An open source utility that i had installed on my Lubuntu 14.04 system, decided to blitz several of my precious folders. I can look into the ‘Trash‘ folder and see them all there, but the installed system utilities would not let me open them or copy them out. How to do that ? Well googled for a while to find there were a bunch of open source linux tools to help un-delete / un-erase deleted file partitions, and disks etc. 

Well, ok that’s useful, but what about if we just have a few precious files that ended up in Trash by mistake ? How do we get those back ? After reading this: Location of Trash onUbuntu 14.04 well that gave me the location of where ubuntu stores the trash. So had to open a terminal session to get to the command line. Then it all became rather simple.

 The first time i ran this i needed to include the ‘sudo’ prefix to make ubuntu happy enough to let me into this trash folder. Then on my system, my trash is held in my home folder so i changed directories to it here:

sudo cd ~/.local/share/Trash/files/.trash 

then i could use 

ls -al

to see all the stuff in the trash. Ok, it’s there but how do i get it back to my side ? Well simple enough, we have the move command named ‘mv’ and that was the trick. I first tried to move a file as i did NOT want to try moving a valuable directory just in case it all went wrong. So in the trash folder tried this:

~/.local/share/Trash/files/.trash mv DSL.adoc ~/Desktop

press the enter key and voila! My precious DSL.adoc file is moved back onto my ubuntu Desktop. I opened it with a text editor just to confirm it was all there – and it was !!!!

Folders Too ?

So did that for each file i wanted to restore, but what about folder directories ? Could those be retrieved ? Well, tried a non-valuable folder with the MV command and again success !!!

Then did moves for each of my precious folder to get them back to my desktop. Here is screenshot of some of this session: 

recovery sessoin on ubuntu 14.04

 

Have not checked permissions or ownership bits but am not fussed, as i have my valuable data back again – no big tools, utilities, etc. just knowing where the trash is on your system, the ability to change directories into that location and use of the mv command.

Note that your trash may be located at a slightly different address so you may need to hunt a little to find it. But i’ll bet your files might still be there waiting for you if you just know where !

Hope this helps you – give this post a LIKE if it does ! Happy recovery !!!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s