Ubuntu – Undo sudo rm -R /*

rmserversudo

I stupidly ran sudo rm /* followed by sudo rm -R /*

My sites still run, although the vast majority of commands like ls are now broken.
Is there a simple way to get data off the server or reverse some of damage?

Best Answer

There is no undo for sudo. It's a one time root runtime privilege. To better explain its like deleting your Win32 folder for Windows and wondering how to get it back. A simple re-install should fix your issue. I would recommend next time reading MAN on rm to better understand what the command does

A simple reading of any terminal command before executing them would be in your best interest for you server, so no more unnecessary function are carried out!

This should better Illustrate my meaning

enter image description here