I am (was) running a Minecraft server in my second computer (Debian).
I was deleting some files in the server and i did rm -rf /*
instead of rm -rf *
, which deleted everything that did not require root.
I shut down the computer immediately, then booted into a live usb and tried to recover the minecraft server located at /home/<user>/minecraft-server
with both testdisk
and ext4magic
. I was a able to recover a file with the same name located in the same place which contained kind of a console log. The log contains only the commands I had previously entered into the terminal.
I recovered some other directories which I don't really need and they were perfectly fine. The file I needed vanished.
Is there any chance of getting it back, and what was that log file with previous commands.
.bash_history
. As for file recovery, that's going to depend on the underlying file system and your time and effort. – Aaron D. Marasco Mar 21 '22 at 20:10.bash_history
. Anything testdisk didn't find is basically gone. You might be able to recover fragments of files, but reassembling them and filtering out old copies can't be done automatically and is usually not worth the time. – user10489 Mar 21 '22 at 22:11.bash_history
file. This file stores all the command that you type in the terminal. It stores all the recent commands and allows the terminal to recall the previous commands when you click the upward arrow on your keyboard when using terminal. – David Kariuki Mar 22 '22 at 11:15