Comments on: rm -rf / https://pthree.org/2009/01/07/rm-rf/ Linux. GNU. Freedom. Tue, 31 Oct 2017 18:00:46 +0000 hourly 1 https://wordpress.org/?v=5.0-alpha-42127 By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109346 Fri, 09 Jan 2009 18:26:24 +0000 http://pthree.org/?p=801#comment-109346 Again, as already mentioned in previous posts, the command you present is a very deliberate command. As mentioned in the post, 'rm -rf /' could happen as the result of a careless typo. There's nothing from stopping you to 'dd if=/dev/zero of=/dev/sda' either, but, that command is very specific and deliberate.

]]>
By: Ebrahim https://pthree.org/2009/01/07/rm-rf/#comment-109345 Fri, 09 Jan 2009 17:23:03 +0000 http://pthree.org/?p=801#comment-109345 find / -delete

]]>
By: Technology » Blog Archive » Vandrei Blog » Blog Archive » Exchange System Manager https://pthree.org/2009/01/07/rm-rf/#comment-109335 Thu, 08 Jan 2009 23:29:38 +0000 http://pthree.org/?p=801#comment-109335 [...] Aaron Toponce : rm -rf / [...]

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109333 Thu, 08 Jan 2009 20:55:31 +0000 http://pthree.org/?p=801#comment-109333 Ubuntu, Fedora, openSUSE, Debian, Arch, FreeBSD, Solaris, Even your beloved Mac OS X must all be stupid. Stupid, stupid, stupid. We're all doomed now that we're becoming like Microsoft. Doomed, I say! DOOMED!!

Now come out of your coma, and look at the technical advantages things brings to the table. Your ignorance is overwhelming.

]]>
By: F-Ubuntu https://pthree.org/2009/01/07/rm-rf/#comment-109332 Thu, 08 Jan 2009 19:14:13 +0000 http://pthree.org/?p=801#comment-109332 This is stupid!

Now they are going to limit to what we do on our own machines?

Ubuntu is turning into Mircosoft...

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109331 Thu, 08 Jan 2009 18:31:50 +0000 http://pthree.org/?p=801#comment-109331 Removing your home directory doesn't hose your system. You just lose your data, and if you have a backup (you do have a backup of your data, don't you?), you restore, and move forward. No big deal.

]]>
By: Robert Ames https://pthree.org/2009/01/07/rm-rf/#comment-109330 Thu, 08 Jan 2009 17:39:16 +0000 http://pthree.org/?p=801#comment-109330 How about preventing:

rm -rf ~

...can easily make same typo mistakes.

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109328 Thu, 08 Jan 2009 17:30:08 +0000 http://pthree.org/?p=801#comment-109328 I'm fully aware of your versus you're. What you caught was a simple typo. Thanks for the English lesson, however. I'm sure some other readers appreciate it.

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109327 Thu, 08 Jan 2009 17:28:58 +0000 http://pthree.org/?p=801#comment-109327 rm -rf --preserve-root /

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109326 Thu, 08 Jan 2009 17:28:29 +0000 http://pthree.org/?p=801#comment-109326 Yeah. That's the exact problem with frozen releases on distributions.

]]>
By: Tom https://pthree.org/2009/01/07/rm-rf/#comment-109325 Thu, 08 Jan 2009 17:19:43 +0000 http://pthree.org/?p=801#comment-109325 Most people who make this mistake don't make it because they don't know the difference, but because they were typing quickly, are auditory thinkers/learners, and failed to re-read their post.

The only you're/your mistake up until your post is Aaron's reply in thread 11. This is Aaron's blog, and he's used it correctly everwhere else. Your post is unnecessary and you're irritating.

]]>
By: Tom https://pthree.org/2009/01/07/rm-rf/#comment-109324 Thu, 08 Jan 2009 17:13:54 +0000 http://pthree.org/?p=801#comment-109324 The change was made to coreutils way back in 2006, it just took this long to percolate through.

Here's the git: http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=aff5a4f2ab86f2a51db8f1d1d734406dc4bd8fb3

]]>
By: Mohan https://pthree.org/2009/01/07/rm-rf/#comment-109323 Thu, 08 Jan 2009 17:11:42 +0000 http://pthree.org/?p=801#comment-109323 This is very good, as some idiot won't post it in a forum as a solution and some poor sap does it and erases his whole install.

]]>
By: Martin Barrett https://pthree.org/2009/01/07/rm-rf/#comment-109322 Thu, 08 Jan 2009 16:59:32 +0000 http://pthree.org/?p=801#comment-109322 I don't understand why "you're" and "your" are so constantly confused. Here's one way to remember which is which.

"you're" has an apostrophe in it, which signifies something has been omitted. What in this case? The "a" in "are", of course: "you're" means "you are". That means it is the other form, "your", that is the possessive form, as in "your mindset"...

]]>
By: Tom https://pthree.org/2009/01/07/rm-rf/#comment-109321 Thu, 08 Jan 2009 16:35:46 +0000 http://pthree.org/?p=801#comment-109321 He probably hit Ctrl+C. Or someone else logged in with privileges saw their files disappear and ran 'killall rm' or equivalent. It's very doubtful it stopped for the reason Shane says.

]]>
By: Tom https://pthree.org/2009/01/07/rm-rf/#comment-109320 Thu, 08 Jan 2009 16:31:04 +0000 http://pthree.org/?p=801#comment-109320 "which of course makes no sense. "

Was the 'no' a typo? Or what don't you think makes sense, exactly?

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109313 Thu, 08 Jan 2009 14:27:41 +0000 http://pthree.org/?p=801#comment-109313 Again, this came upstream from Debian. This came from GNU itself. While I agree with you that distributions should not dictate what a user should and should not run, safety nets are in place all over for security and safety. Why do you have to be root to run the command? Is the distribution dictating who can run it? Your mindset is the silly one, no one else's I'm afraid.

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109312 Thu, 08 Jan 2009 14:25:31 +0000 http://pthree.org/?p=801#comment-109312 You don't understand the difference between files and directories if you're presenting this as an argument. In this case, run:

'rm -rf /*'

You're not removing the root directory, but everything beneath it. --preserve-root doesn't take effect, because you're not removing root. You're removing nested directories.

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109311 Thu, 08 Jan 2009 14:23:17 +0000 http://pthree.org/?p=801#comment-109311 The 'rm -rf /' is to keep typos from happening. The find command above is very specific, and apparently, the user knows exactly what he wants to do. We shouldn't keep the user from doing destructive things, as maybe this is what he wants to do, but we should keep the user from doing something destructive from a simple typo, like those described in my post.

]]>
By: Aaron https://pthree.org/2009/01/07/rm-rf/#comment-109310 Thu, 08 Jan 2009 14:21:54 +0000 http://pthree.org/?p=801#comment-109310 That's odd. Unix and Linux both will saw off the very branch they're sitting on. 'rm' should be loaded into RAM, so it should take out the entire system regardless.

]]>
By: Andrew https://pthree.org/2009/01/07/rm-rf/#comment-109309 Thu, 08 Jan 2009 13:45:33 +0000 http://pthree.org/?p=801#comment-109309 Actually, this is quite silly. Distros in NO way should dictate what they think you should or should not run, regardless of their effect. A classic example of debian's mindset, sadly.

]]>
By: giulivo navigante https://pthree.org/2009/01/07/rm-rf/#comment-109307 Thu, 08 Jan 2009 13:28:25 +0000 http://pthree.org/?p=801#comment-109307 but

cd / && rm -rf *

will still work
this strange preserve option seems to me just a stupid idea

]]>
By: Shane https://pthree.org/2009/01/07/rm-rf/#comment-109306 Thu, 08 Jan 2009 13:20:24 +0000 http://pthree.org/?p=801#comment-109306 @lefty: Maybe HP-UX is looney or my stepfather is.

]]>
By: atc https://pthree.org/2009/01/07/rm-rf/#comment-109305 Thu, 08 Jan 2009 12:05:32 +0000 http://pthree.org/?p=801#comment-109305 I'm pleased to see this. Makes a lot of sense to me.

]]>
By: lefty.crupps https://pthree.org/2009/01/07/rm-rf/#comment-109302 Thu, 08 Jan 2009 05:30:00 +0000 http://pthree.org/?p=801#comment-109302 "it removed everything until it came across the rm command"
Interesting; the command that you run is usually loaded into memory, so that even after removing the executable, it should still be running...

]]>
By: Clamoroso: rm -rf / non funziona più :D « pollycoke :) https://pthree.org/2009/01/07/rm-rf/#comment-109300 Wed, 07 Jan 2009 23:07:43 +0000 http://pthree.org/?p=801#comment-109300 [...] adesso m -rf non è più così pericoloso. Guardate cosa succede in una installazione recente di Debian/Ubuntu (>=8.04, ma sembra che la [...]

]]>
By: web123 https://pthree.org/2009/01/07/rm-rf/#comment-109299 Wed, 07 Jan 2009 21:07:39 +0000 http://pthree.org/?p=801#comment-109299 Fedora 8 :
# rm -rfi /
rm: cannot remove root directory `/'
# rm --help | grep -- --preserve-root
--preserve-root do not remove `/' (default)

]]>
By: Jef Spaleta https://pthree.org/2009/01/07/rm-rf/#comment-109296 Wed, 07 Jan 2009 17:11:40 +0000 http://pthree.org/?p=801#comment-109296 Fedora 10: rm from coreutils-6.12-18.fc10 package
uses the preserve-root defaults.

Fedora 9: has coreutils-6.10-18.fc9
I suspect preserve-root is default there but have not tested.

Centos 5.2: coreutils-5.97-14.el5
no-preserve-root is the default

I think I'm going to go ahead and add --preserve-root to the system wide rm alias on my centos 5.2 system.....

]]>
By: Kirrus https://pthree.org/2009/01/07/rm-rf/#comment-109295 Wed, 07 Jan 2009 16:46:10 +0000 http://pthree.org/?p=801#comment-109295 Great! That would have saved me from myself once :/

Now all we need is to add the same sort of thing to find - this command is equally as destructive:

find / -ctime +60 -exec rm {} ;

(note the '/' instead of '.')

]]>
By: Shane https://pthree.org/2009/01/07/rm-rf/#comment-109294 Wed, 07 Jan 2009 15:31:53 +0000 http://pthree.org/?p=801#comment-109294 My stepfather tried rm -rf / on an old machine running hpux back in the day and it removed everything until it came across the rm command and it just quit. His system was hosed, but all the files weren't deleted. 🙂

]]>
By: jonathan https://pthree.org/2009/01/07/rm-rf/#comment-109293 Wed, 07 Jan 2009 15:21:18 +0000 http://pthree.org/?p=801#comment-109293 Nice, but rm -rf /tmp/something * is my favorite 🙂

]]>
By: Erik https://pthree.org/2009/01/07/rm-rf/#comment-109291 Wed, 07 Jan 2009 15:02:49 +0000 http://pthree.org/?p=801#comment-109291 I kept meaning to try this sort of thing for myself. Definitely an example of a good time to protect the user from themselves!

]]>