0

I was just reading some text file and some keys were pressed by me on keyboard and all text was gone from that text file and by mistake I closed that file by "closed with saving" option. This text file is very important for me. I have checked it as hidden file in that folder but It is not showing. I have also used command sudo strings /dev/mem but it is showing some text which I can't understand and I also used sudo strings /dev/mem | grep -r some text of file but It got paused and not showing anything.

So, I would like to know, Is there any way to go to last saved state of that text file. Please help.

ankit
  • 133
  • 1
    this answer on a similar question might help: https://askubuntu.com/a/3912/631600 – pLumo Jan 16 '19 at 12:03
  • @RoVo Thanks for the response. I have used extundelete but after running the command , it is showing "Bad magic number in super-block when trying to open filesystem /dev/sda4 " . I am also new to ubuntu. Can you please help ? – ankit Jan 16 '19 at 12:34
  • the answer i linked is grep -a -B 25 -A 100 'containing string' /dev/sda1 > result.txt – pLumo Jan 16 '19 at 12:35
  • @RoVo , I have used it but it is showing no such file or directory although path is correct. Please check where I have written wrong in the command : grep -a -B 25 -A 100 'gateoverflow.in' /home/ankit/Desktop/GOVol3Practice.txt > result.txt ....My file has name GOVol3Practice and it is on Desktop. – ankit Jan 16 '19 at 12:53
  • Replace /home/ankit/Desktop/GOVol3Practice.txt with the path to your device (/dev/sdXY). – pLumo Jan 16 '19 at 12:58

0 Answers0