Mmm… fork bombs…

There’s an old quote: “Unix doesn’t prevent you from doing stupid things because that would also prevent you from doing clever things.”

So, we’ll start with a yummy, delicious fork bomb–a classic from the past:

:(){ :|:& };:

Old, elegant, and oddly — unless you actually use it maliciously — very effective at testing your ulimits and overall system performance. Not malicious to the point of data loss as it will, on a poorly-configured system, only flood it with running programs.

So, what kind of OS would let you do this? The same kind that would let you do this as the local administrator:

sudo rm -rf /

Basically, wipe out the entire root of the system and, if applicable and configured appropriately (or, rather, unsafely), every single attached network volume.

Mistakenly type that on one of your core systems to which you’ve attached all of your network storage (in read mode) and you’re likely going to have a very, very bad day.

However, if you need to quickly and legitimately wipe out the root volume on a Unix system, that’s pretty handy. And, slightly modified, it’s also handy for removing very large directory structures just about anywhere. So, very, very handy.

Before you go getting on a soapbox and start screaming, “See! See! Unix is dangerous!” let us direct our attention to Windows:

Another classic from the past. This time for DOS and Windows (that, sadly, doesn’t work anymore) is this one:

echo y | format c: /s /q /vol:bugfree

The one worked on Windows ME and older. And, with Windows 98 still in the wild, but in endangered numbers, it’s still semi-useful. This one, when used inappropriately, is malicious as it instantly formatted the C: drive. Can’t do it anymore because the job of Windows is now to protect you from yourself.

What if we need to quickly and legitimately wipe a Windows installation? Sorry. Nothing available in the OS for that.

All those layers of protection, restriction, and oversight now added to Windows means that–even as the administrator, in charge of everything on the system–it’s more and more difficult to do useful, efficient things.