Hacker News new | ask | show | jobs
by paul_f 4852 days ago
Haha, good one. Here's another harmless command you can try. It's fun!

sudo rm -rf /

2 comments

I wouldn't joke with that.. Someone may actually try and lose a lot of time and data. Yes, most HN readers will get your 'joke', but possibly not all.
It'd teach them not to run random commands they found on the internet, what rm does, and to make backups. Three valueable lessons.

That is, if it would actually work: modern rm implementations have a special case for /. Read the manpage and/or try this instead:

rm -rf --no-preserve-root /

Its atleast disabled by default in latest versions of Ubuntu and other distros, but regardless paul_f shouldn't have posted it without any disclaimer.
If you blindly run code you find on the Internet without understanding what it does, you deserve all you get.
In case anyone didn't know, this command would recursively remove all files and directories on the entire filesystem.
No it [most likely] wouldn't. Read the manpage.
To clarify to anyone not fammilar with rm, running `rm /` is such a stupid thing to do, that rm has a special case where if won't let you delete "/". To override this behavior, you need the flag "--no-preserve-root".