How to recover crashed text/program (.c .cpp or .java etc.) file in linux?

You were typing/editing a file using vi/vim and then by mistake you close your terminal or power down etc etc.

Yes, we can recover your data in vim using .swp file.

Don't simple delete .swp file it is very useful.

Very simple!! "vim <filename>Select option "R" and Press Enter"

Let check how, 

1) $ vim info.text

Open File in Vi or Vim

We by mistake click on close and then try to re-open file again

3)$ vim info.text

Select option "R" and Press Enter
Select option "R" and Press Enter

4) Select option R and press enter

Press Enter to continue

5)Recovered file

6)Now we can edit this file again  and it crashed again 😇

Bad Luck it crashed again

7)Select option R and press enter

Select option "R" and press enter
Select option R and press enter

Choose time from highlighted to latest

Select latest timestamp
Select latest timestamp

9)press enter

Press Enter to Recover
Press Enter to Recover

10)Recovered Again

PREV:: Undo and Redo changes in vim/vi editor


Your Comments /Suggestions & Questions are always welcome. We would like to help you with best of our knowledge. 
So feel free to put Questions.  

No comments:

Post a Comment