somehow did "rm -rf /*" and restored it BUT ..
I accidentaly did
Code:
rm -rf /* now /bin is back .. i am able to make new sessions with server which i was not able to after "rm" command .. now I am not sure what else got deleted from this server .. is there any way to get a list of recently deleted files so I could restore these files ? |
if /boot is untouched then only /bin is affected when you issue rm -rf /* it will delete your files in alphabetical order.
if /boot doesn't not exist then /dev is the next, then /etc, /home and so on. But if /boot is still there you are lucky and I'm not sure you deserve it :D |
Quote:
am I right ? |
Thank god .. I have backup of /boot too. I'll restore it :D ..
|
If dev is empty it's not a problem, a reboot should fix it.
But look at etc before. Anyway if /boot is still there it shouldn't have deleted anything in /dev |
I would suggest using a regular user, instead of root -- in the future.
Also, if you are extremely paranoid, as you should be as a system-admin, you can always make a small function that looks for 'rm -rf /' being executed and warns you, or just completely disallows you -- so you have to go through several hoops to make a mistake like that. |
Quote:
Fortunately, I handle both backup and Linux. :D .. |
Quote:
Code:
sudo rm -rf /* Code:
sudo rm -rf ./* yes .. I forgot the dot or i pressed it very lightly on the keyboard .. |
Well, IMHO the real issue here is -rf, I've used to use those flags a lot as well and they are evil -f flag is evil, -r is pretty evil and all together are super evil. I've lost the habit of using them.
Also aliasing rm to rm -I is a good idea |
I don't think there's a single experienced Linux admin here who hasn't done something similar when they were first starting out. Usually it results in a format and re-install of the OS, but since you had backups you may be able to recover. There's no better way to learn caution when using rm than accidentally doing something like this though.
|
ok, to be honest i did
Code:
rm -rf ~* instead of *~ |
I once did a rm -rf / on a linux install a long time ago in 2005. The difference is I did this on purpose to see what would happen. I was going to install another distro anyways.
When I ran rm -rf / it last until rm was no longer available i.e the bin directory was wipe out and rm no longer exited to continue the rest of the deletion. |
Are you sure of this behavior? I think it should go on
|
Quote:
I dont know what was hte condition in 2005, but in 2012 rm will flat every directory's ass. |
Maybe it depends if it's dynamically linked or compiled with static libs.
|
All times are GMT -5. The time now is 03:44 PM. |