Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Do any Linux distros prevent the execution of sudo rm -rf /* so that people do not accidentally delete their hard drives if they did not know what they are doing?

share|improve this question
6  
Shoot. that's a cron job of mine. Keeps the box virus free! :) –  kobaltz Aug 8 '13 at 20:59

2 Answers 2

up vote 9 down vote accepted

No; you are expected to know what you are doing. Look on the bright side! You almost certainly won't shoot yourself in the foot more than once.

share|improve this answer

The answer is not by default.

Let me add that the risk can be more subtle than your bare-bones example. Take this example:

[user@server ~]$ sudo rm -rf directory_to_delete /*

The accidental space between the directory_to_delete and the /* means that it's going to operate on both the directory_to_delete and /*, the root folder, as the root user. And it's going to do it recursively, so there goes your OS install.

That's why you need to be extremely careful when using rm -rf, especially with sudo.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.