I accidentally deleted a file from my laptop. I'm using Fedora. Is it possible to recover the file?
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:
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.
It is possible, its just going to be a hassle.
UPDATE: before you try this method, please have a look at Steven's answer
You're going to need the testdisk package, a lot of disk space and a lot of time.
PhotoRec, a part of TestDisk, can recover files from almost any disc. PhotoRec does support finding
First, install testdisk by running
note: Your going to need a lot of free space on another drive, where you can save recovered files.
Recover all the deleted files on your disc by running
and follow the instructions... ( remember not to save the files to the same disc you are recovering from )
After the proccess has completed, all the recovered files should be in one directory, where you should run:
This will output a list of files that might be the one you lost. You will have to check all of them, as the filenames will be lost.
Many text editors keep backup files. If you are really lucky, there might be something like yourfile.tex~ including a previous version of your file.
There are other data recovery tools and the most effective are foremost, photorec, scalpel and magic rescue. (I'm assuming that the 'grep' trick told here is not enough) Here you can find some tutorials about how to use them: