I have unfortunately deleted some important files and folders using 'rm -R ' command in Linux server.
Is there any way to recover?
To recover deleted files you will be provided with a single file recovery option and all files recovery option. If you want to recover a single file, you can go with “-restore-file”. On the other hand, if you want to restore all deleted files, you can go with “-restore-all”.
Select Trash from the left sidebar to access the Trash. Right-click on the file, choose Restore from Trash to recover the file and move the file back to its original location. 3. Finally, navigate to your deleted file's original location to see the successfully restored the file.
Usually, running the rm command tells the system to label the inode and the data blocks of the file as unused. In older Linux versions, it used to be possible to retrieve the data, but nowadays, the metadata is wiped, and nothing is recoverable.
since answers are disappointing I would like suggest a way in which I got deleted stuff back.
I use an ide to code and accidently I used rm -rf from terminal to remove complete folder. Thanks to ide I recoved it back by reverting the change from ide's local history.
(my ide is intelliJ but all ide's support history backup)
Short answer: You can't. rm
removes files blindly, with no concept of 'trash'.
Some Unix and Linux systems try to limit its destructive ability by aliasing it to rm -i
by default, but not all do.
Long answer: Depending on your filesystem, disk activity, and how long ago the deletion occured, you may be able to recover some or all of what you deleted. If you're using an EXT3 or EXT4 formatted drive, you can check out extundelete
.
In the future, use rm
with caution. Either create a del
alias that provides interactivity, or use a file manager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With