1

I accidentally deleted a jupyter notebook file on my Google Cloud instance. I wonder if there's anyway to restore/recover the file?

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
Pedram
  • 2,421
  • 4
  • 31
  • 49
  • how did you delete it? with `rm` ? – Travis Webb Nov 18 '19 at 06:14
  • @TravisWebb No, I had the jupyter notebook browser open, instead of shutting down my notebook I pressed the removing button. My jupyter notebook files are on my Google Cloud instance (I'm running jupyter on GC server), you're suggesting that it does not have anything to do with Google Cloud? – Pedram Nov 18 '19 at 06:16
  • check this out https://stackoverflow.com/questions/38819322/how-to-recover-deleted-ipython-notebooks – Ahmed Soliman Nov 18 '19 at 06:32
  • You can try using [`extundelete`](http://manpages.ubuntu.com/manpages/precise/en/man1/extundelete.1.html) but there are no guarantees. I don't think this has much to do with Google, seems like a Jupyter-specific issue. – Travis Webb Nov 18 '19 at 06:42
  • @ahmed.soli had already tried every solution there, did not work for me. – Pedram Nov 18 '19 at 06:44

1 Answers1

6

Thanks to this link, I found the solution. Files deleted in the browser should probably be in a Trash folder. In my case and on my Google Cloud instance, the deleted files were in the following path.

cd ~/.local/share/Trash/files/

By using ls, list the files and see if your file is in this folder. If yes, then simply using the mv command you can move your deleted file to the path you want.

Innat
  • 16,113
  • 6
  • 53
  • 101
Pedram
  • 2,421
  • 4
  • 31
  • 49