There is no shell cmd to recover. All recovery programs do a search for file headers and attempt to restore.
-- so after several weeks of pondering... I have figured out how to recover a deleted file on linux by just using command lines.
i thought about writing a perl script to excute it from linux but that was too much work.
anyhow, good news..
lsof is a Linux tool which can show open files and network connections, and even recover deleted files!!!!
more info on lsof >>> http://www.catonmat.net/blog/unix-utilities-lsof
http://linux.about.com/library/cmd/blcmdl8_lsof.htm 1) $ lsof | grep datafile.txt
this will output something like ....xxxx 32140 servername 56w xxx ##,# #### / log folder/datafile.txt (deleted)
the32140 is the process that still has the file open and without this process keeping the file open, then the file is lost permanently, hence the process id 32140 and finally look for the file descriptor (fd) which is the 56 (of course this will be different)
Also the idea is to look for the word "deleted"
2) $ cat /dev/32140/fd/56
this outputs the contents of the deleted datafile.txt, which the data is still there so all you need is to redirect the contents back to your directory/original file like this:
3) $ cat /dev/32140/fd/56 > /datalogs/datafile.txt
and whoola.. you have just recovered your datafile.txt with all the data back to its original location.