Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rm (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Protection of the filesystem root === The <code>rm -rf /</code> command, if run by a [[superuser]], causes every file of the file system to be deleted. For safety, [[Sun Microsystems]] introduced special protection for this command in [[Solaris (operating system)|Solaris]] 10 (first released in 2005). The implementation reports that removing {{code|/}} is not allowed.<ref>{{Cite web|url=https://blogs.oracle.com/jbeck/date/20041001%23rm_rf_protection|archive-url=https://web.archive.org/web/20161103124127/https://blogs.oracle.com/jbeck/date/20041001|archive-date=2016-11-03|url-status=dead|title=Meddling in the Affairs of Wizards}}</ref> Shortly thereafter, the same functionality was introduced into the [[FreeBSD]] implementation.<ref>{{Cite web|url=https://github.com/freebsd/freebsd/commit/d6b7bd90c2776d9ccd8bb7f33a899bd213aebf85|title=The previous commit added code to rm(1) to warn about and remove any Β· freebsd/freebsd@d6b7bd9|website=GitHub}}</ref> The [[GNU]] version refuses to execute <code>rm -rf /</code> unless the <code>--preserve-root</code> option is included,<ref>{{Cite web|url=https://www.gnu.org/software/coreutils/manual/html_node/rm-invocation.html|title=rm invocation (GNU Coreutils)|website=www.gnu.org}}</ref> which has been the default since version 6.4 of [[GNU Core Utilities]]. In newer systems, this [[Fail-safe|failsafe]] is always active, even without the option. To run the command, user must bypass the failsafe by adding the option <code>--no-preserve-root</code>, even if they are the superuser.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)