LWN.net Logo

rm -rf / limitation is from Solaris

rm -rf / limitation is from Solaris

Posted Apr 3, 2009 23:00 UTC (Fri) by tzafrir (subscriber, #11501)
Parent article: Shortening the rope

Limiting 'rm -rf /' came from Solaris originally:

http://blogs.sun.com/jbeck/date/20041001#rm_rf_protection

And this is not only Ubuntu. E.g.: http://blog.venthur.de/2008/11/10/rm-rf/


(Log in to post comments)

rm -rf / limitation is from Solaris

Posted Apr 4, 2009 0:03 UTC (Sat) by nix (subscriber, #2304) [Link]

I wonder whether Solaris got it first or GNU coreutils?

* Major changes in release 5.1.0 (2003-12-21):

** New features
[...]
chgrp, chmod, chown, and rm accept the new options:
--preserve-root, --no-preserve-root (default)

rm -rf / limitation is from Solaris

Posted Apr 4, 2009 9:10 UTC (Sat) by tzafrir (subscriber, #11501) [Link]

Hmmm.... when you accidentally run 'rm -rf /' do you take the time to add --preserve-root to the command-line?

That extra switch is nice. However according to the coreutils changelog, --preserver-root was made the default of rm on 2006-02-09 (didn't check to which version it applies).

That 2004 blog entry is after the Solaris guys successfully changed POSIX, which I assume takes its own extra time.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds