Hello and welcome to LQ. Sorry to see it's kind of a sad occasion that brings you here.
Originally Posted by jasbhatti
How to Recover Deleted File in Linux
Recovery depends on a few factors:
0. Filesystem type.
Journalling filesystems do not just unlink like VFAT and Ext2 did, they're way more efficient making recovery harder.
1. Time of incident.
The longer the space a deleted file has occupied is left that way the less chance for recovery there will be.
2. Disk activity.
The amount of writing to a partition varies. Some see relatively few (/boot, /usr), some more (temp dirs) and some are written to continuously (like /var). The more a partition gets written to the higher the chance unallocated space gets reallocated.
These three together should give an indication.
Procedure-wise the first thing to do is make sure the partition is mounted read-only. Then allocate space to write to. This can be another partition, another harddisk or external media. Never write to the partition to recover from. Making a copy of the partition the deleted file is on using 'dd' makes it easy to transport it to others who may be able to help you and makes it easier to use other tools on other platforms if you so decide.
The most-used tools AFAIK still are Photorec and Foremost. Here's a link to how to use Photorec: http://www.linuxquestions.org/questi...9/#post3013131
and one for Foremost: http://www.linuxquestions.org/questi...32#post2960932
. You should try Photorec first. Note that due to indication above and methods of recovery there is no guarantee the file can be recovered at all, in full or be usable.
Originally Posted by jailbait
When you want to recover a deleted file you restore it from your backup.
While it's a good hint I do not see how your answer helps the OP recover his deleted file *now*.
Couldn't you add pointers to threads with recovery commands?