1

I was working with C++ file (.cpp) and just wanted to rename the name of file but unfortunately I used rm and it deleted that file, I checked the trash but cannot find the file there, is there any way I can recover my file?

This is the command I used.

rm infix_to_postfix.cpp infix_to_postfix_and_prefix.cpp
  • As far as I know, no, there isn't. Not if you used the command line to remove it. If there is, I guess I'd be interested in finding out as well! – Ray Nov 23 '21 at 02:51
  • 1
    Does this answer your question? [Can files/directories deleted with rm be restored?](https://askubuntu.com/questions/6698/can-files-directories-deleted-with-rm-be-restored) – cocomac Nov 23 '21 at 05:11
  • Take a look at [**photorec**](https://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step) it actually works very well and is not targeted against image-files only, have seen surprising results were I never would have believed files could be restored. Use it with care (!!), or you end up with a zillion refound files you have to look through manually :) – davidkonrad Nov 23 '21 at 07:57

0 Answers0