how to recover a .c file in AIX unix which has removed (rm -f) by accidentally
migrated from stackoverflow.com Feb 4 '10 at 14:25
This question came from our site for professional and enthusiast programmers.
Just grab it from your daily/weekly backups
You have backups right?
Coincidentally, there is an FAQ at FAQS for this. Follow directions at your own peril...
If your FS is not journal-enabled and you remember any "unique" string in the content of the file you can use as a search seed a simple way is to:
Of course you have to adjust -B and -A grep options, in order to be able to retrieve the entire file (set the lines before and after the searching string you have to grep). Redirect grep output on a new file and adjust it to remove exceeding heading and trailing lines.
I used this method a number of times, with very good results.