Getting a deleted file
I have run a rm command on one of my files.This file was actually a file named .MR_ASSESS.swp and later when I opened a file MR_ASSESS I cannot find all my data that was there in the .MR_ASSESS.swp file is there any way that I can get this data.
Please help.Any input with this regard is apprciated. Ajit |
Try foremost or testdisk (both recommended in this thread - I haven't actually tried them myself). Like it says in the thread, you will only be able to recover it if you haven't subsequently overwritten the actual data in the file.
|
Quote:
This will rename the normal rm file. PHP Code:
PHP Code:
give it 755 permission. Now rm will send files to trash and you can recover them or permanently remove them. |
And your new rm script will be overwritten by the real rm once your package manager updates coreutils.
|
So better than write a script is to write the function and put it in both ~/.bashrc and ~/.bash_profile:
Code:
function rm { |
Quote:
PHP Code:
|
@MTK358: Actually this script can be placed into ~/bin
Just create ~/bin, put the script into this directory, change its permissions Code:
chmod +x ~/bin/rm Code:
PATH=/home/xxxxx/bin:$PATH: |
Quote:
|
Quote:
|
Thanks for all your suggestions.SO i think recovery procedures are the only ways that I can use.Are there any preventive measures that I can use.Also all you people keep refering to thrash folder How do I go about creating this folder and setting my rm command such that every time an rm command is run it outputs it to thrash first.
|
Quote:
I've done some work on the rmw script mentioned in the post linked above. It's less "weak" now. :) ReMove to Waste http://sourceforge.net/projects/rmw/ It has a few easy methods of restoring, and can also, if Desktop Trash is enabled, ReMove files so they'll show up in the Trash on KDE, GNOME, or Xfce (for even easier restoration). I haven't tested other GUI environments yet. It still needs some work, but good enough for beta testing, IMO. |
All times are GMT -5. The time now is 12:15 AM. |