Recovering accidentally deleted files

I accidentally deleted a file from my laptop. I'm using Fedora. Is it possible to recover the file?

ANSWER:-

I would advise against immediately installing some utility. Basically your biggest enemy here are disk writes. You want to avoid them at all costs right now.
Your best bet is an auto-backup created by your editor--if it exists. If not, I would try the following trick using grep if you remember some unique string in your .tex file:
$sudo grep -i -a -B100 -A100 'string' /dev/sda1 > file.txt
Replace /dev/sda1 with the device that the file was on and replace 'string' with the unique string in your file. This could take some time. But basically, what this does is it searches for the string on the device and then returns 100 lines before and after that line. and puts it in file.txt. If you need more lines returned just adjust the -B and -A options as appropriate. You might get a bunch of extra garbage returned, but you should be able to get your text back.
Good luck.

0 comments:

Post a Comment

Don't Forget to comment