Lunduke
News • Science & Tech
The Fork Bomb: What it is, how it works, and where it originated
The idea started in 1969... and it's been causing computers to crash ever since.
December 03, 2023
post photo preview
:(){ :|:& };:

That simple line has been crashing systems in the Linux world for years — It is known as the (infamous) “BASH Fork Bomb”.

When run in a GNU/BASH shell, this BASH variant of the Fork Bomb will bring your average Linux system to its knees, lickety-split. A mere handful of characters that can cause a computer to cry “Uncle.”

But what, exactly, is a “Fork Bomb”? How do they work? And where on this green Earth of ours were they first created?

Come with me on a journey into the history, design, and usage of one of the most dastardly ideas in all of computing… of The Fork Bomb!

What is a Fork Bomb?

The idea of a Fork Bomb is simple: Create a piece of code that does one thing and one thing only: replicate running instances of itself. And do so as quickly as possible.

Here, a visual will help drive the idea home.

In this case each Bunny Rabbit represents one instance of the Fork Bomb. Each bunny makes two new bunnies. Quickly. Multiplying like, well, rabbits.

Each of those adorable little bunny rabbits may not take up much RAM… or much CPU time… but imagine 20 of them. Or 1000. Or, like, a bazillion?! That Fork Bomb will continue making running copies of itself just as long as the system allows it to (by continuing to have available memory or not fully crash).

With how quickly each Fork Bomb replicates itself… and the number of copies growing exponentially… you can see how they can become a problem in a hurry. Often causing a system to lock up quicker than you can say, “Maybe I shouldn't have pressed Enter.”

A real-world example… and how it works

Let’s take a look at that BASH version of the Fork Bomb again (as that is one of the most popular and famous examples).

(If you don’t know how BASH scripting works, no worries. I’ll break it down… make it nice and easy.)

:(){ :|:& };:

Ok. So how does this, ridiculous looking, collection of semi-random seeming characters, actually work?

Let’s break that apart into multiple lines to make it all easier to read.

: ( ) {

   : | : &

} ; :

This… is a BASH script function.

But there’s something… weird about it. Note the many usages of “:”? In this case “:” is being used as a function name.

“Why is using “:” as a function name weird,” you ask?

Because, on most UNIX-y systems, it is not allowed to use a character in a function name other than letters and numbers (and underscores). But the GNU version of BASH — which is commonly used on oh-so-many Linux systems — allows : and so many other characters to be used.

Why does GNU allow a “:”? Who knows. GNU be crazy.

Regardless…

Let’s replace the “:” in that BASH script with “rabbit”. That will, in addition to making it run on more UNIX systems, make this a bit easier to read.

rabbit() {
rabbit | rabbit &
}; rabbit

There. So much better. Here we go. Line by line.

Line 1: rabbit() {

That first line does something simple. It defines a function named “rabbit”. That’s it and that’s all.

Line 2: rabbit | rabbit &

Line 2 is the insidious part.

It calls the function named “rabbit”, and sends the output of that function to the function named “rabbit.”

But, here’s the thing, there really isn’t any output of the “rabbit” function. So this is really just a fancy way of calling the “rabbit” function twice… at the same time.

Yeah. The “rabbit” function calls itself, from within itself, then calls itself again.

Oh, and that “&” at the end? That's the BASH way of telling “rabbit” to run in the background.

The net result? Every “rabbit”, makes two new “rabbit”s.

Line 3: }; rabbit

That last nine simply ends the “rabbit” function… and then calls itself.

Note: I highly recommend not running this code on your system unless you do so in a virtual machine. Without taking the proper precautions… this will bring your system to its knees.

Every variation of a Fork Bomb operates in a roughly similar fashion. A small piece of code that creates copies of itself… repeatedly. Thus eternally replicating itself until the system runs out of resources.

The first Fork Bomb

The very first known usage of a “Fork Bomb” was way back in 1969 at the University of Washington.

There, a Burroughs B5500 computer had been installed three years earlier. A big computer that provided the first time-sharing system on the University of Washington campus (through a series of dial-up modems running at 110 baud). This was also the first computer at the University of Washington to provide disk storage for user files. Pretty cool.

A Burroughs B-5500. Not the one at the U of W, though. Classy looking machine, right?

On that big, beautiful Burroughs B-5500, someone reportedly wrote a small bit of code that would make two copies of itself — over and over again — until the memory of the machine was full and the entire system would crash.

That intrepid programmer named that tiny little program, appropriately: “RABBITS”

Fun historical tidbit: RABBITS for the Burroughs B-5500 was not, technically the first computer virus. That distinction appears to go to the 1971 “Creeper Virus”. While RABBITS predated Creeper by a good two years… RABBITS doesn’t really act like a virus. It requires a user to explicitly run it in order to cause its own mischeif.

The 1974 “Wabbit”

A similar piece of code was written on an IBM System/360, a few years later, in 1974. Clearly inspired by “RABBITS”, this new code was called “Wabbit” and was, as Elmer Fudd might say, quite “wascally”.

The IBM System/360 Model 22 control panel. That thing was awesome looking.

Legend has it that the individual who created “Wabbit” ran the program on the System/360 at work… causing the entire system to crash. The man, again according to legend, lost his job.

Fun bit-o-trivia: As years went on any program that would self-replicate when ran by the user… but wasn’t actually a virus… would become known as a "wabbit.” in honor of this particular event.

Some other variations on the Fork Bomb

There have been Fork Bomb type bits of code written in just about every language you can imagine. At the beginning we covered how to write a Fork Bomb in BASH. But, because this sort of mayhem is simply too much fun, below you will find code to create similar bits of functionality in several other programming languages.

Enjoy.

Just… you know… try not to get yourself fired.

Fork Bomb in C:

int main(void) {
for (;;) {
    fork();
}
}
Fork Bomb in Python:

#!/usr/bin/env python

    import os
    while True: os.fork()

Fork Bomb in Ruby:

#!/usr/bin/env ruby
loop { fork { bomb } }
community logo
Join the Lunduke Community
To read more articles like this, sign up and join my community today
6
What else you may like…
Videos
Podcasts
Posts
Articles
February 07, 2026
With Git Moving to Rust, How Long Until a Git Fork?

Git 3.0 is scheduled to ship "second half of 2026", with a mandatory requirement of Rust. Which means Git will no longer build on many platforms. Setting the stage for a successful fork.

The Lunduke Journal Lifetime Subscription:
https://lunduke.substack.com/p/the-lunduke-journal-lifetime-subscription

More from The Lunduke Journal:
https://lunduke.com/

00:15:13
February 06, 2026
NetBSD Says No to Rust

"Rust in the core of NetSD is probably a non-starter," says long-time NetBSD developer. "Keeping Rust working is quite a bit of work."

The Lunduke Journal Lifetime Subscription:
https://lunduke.substack.com/p/the-lunduke-journal-lifetime-subscription

More from The Lunduke Journal:
https://lunduke.com/

00:20:49
February 05, 2026
PSX Emu Dev Says No Packaging for Arch or NixOS

Connor McLaughlin, the developer of Duckstation, a popular Playstation emulator, calls NixOS and Arch Linux "hostile package environments", and blocks building for those Linux distributions.

More from The Lunduke Journal:
https://lunduke.com/

00:13:03
November 22, 2023
The futility of Ad-Blockers

Ads are filling the entirety of the Web -- websites, podcasts, YouTube videos, etc. -- at an increasing rate. Prices for those ad placements are plummeting. Consumers are desperate to use ad-blockers to make the web palatable. Google (and others) are desperate to break and block ad-blockers. All of which results in... more ads and lower pay for creators.

It's a fascinatingly annoying cycle. And there's only one viable way out of it.

Looking for the Podcast RSS feed or other links? Check here:
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

The futility of Ad-Blockers
November 21, 2023
openSUSE says "No Lunduke allowed!"

Those in power with openSUSE make it clear they will not allow me anywhere near anything related to the openSUSE project. Ever. For any reason.

Well, that settles that, then! Guess I won't be contributing to openSUSE! 🤣

Looking for the Podcast RSS feed or other links?
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

openSUSE says "No Lunduke allowed!"
September 13, 2023
"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

This episode is free for all to enjoy and share.

Be sure to subscribe here at Lunduke.Locals.com to get all shows & articles (including interviews with other amazing nerds).

"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

Feels like this sometimes out in the world.

post photo preview
18 hours ago

Sunday Sounds - Down with the Nerd Herd

For you @GeekOnSkates a "Metal meets Medieval Vikings" song.

I didn't march to my own drummer as a kid nerd refusing to bow to school bullies -- only to, as an adult, bow down to any Nerd Herd trying to be gatekeepers.

https://suno.com/s/fgoFEDg5vxUf0Kj2

Enjoy - I did.

February 07, 2026

Controversial opinion.

I think Lunduke is wrong on Rust.

I has clearly been adopted by the next generation. It can plug in very nicely into various ecosystems and tools. I am planning to adopt it as well for app development (logic part, not the view).

At the end of the day, if modern kids, people etc want to use Rust then it makes sense for the projects to start exploring it and investing in it today.

Not doing so might lead to old timers retiring without anyone left to replace them.

Rust is not a bad language at all. It definitely has a bad reputation for the way it was being pushed a few years back. But honestly, I don't see those "rewrite in Rust" mobs much these days.

U see people doing amazing projects and organic adoption skyrocketing.

That's why I don't think adding Rust into traditionaly C code bases is a bad idea.
It prepares the project for the "changing of the guard".

This was always bound to happen some day if not Rust then Zig or something else but as it turned out, it's Rust.

January 31, 2026
$89 Lifetime Offer Ends at Midnight!

I’ll make this quick: The $89 Lifetime Subscription offer for The Lunduke Journal ends at midnight tonight (Saturday, January 31st).

Once the calendar reads “February” — poof — the deal is gone.

If you wanted to save 70% on a Lifetime Subscription, these are your final hours.

A huge thank you to everyone who has signed up during this crazy deal. We are this close to filling up the 4th Lifetime Subscriber Wall (there’s a possibility it might fill up in the next few hours).

Far beyond anything I was expecting. All of you are absolutely amazing. The Lunduke Journal would not be possible without you.

If you were on contemplating grabbing that Lifetime Sub, I’d jump on it right now. The price goes back up to normal ($300) in about 12 hours or so.

Get it while it’s cheap!

-Lunduke

Read full Article
January 30, 2026
The End of the $89 Lifetime Sub is Nigh!

Quick reminder: The massive deal The Lunduke Journal has been running — 70%+ off Lifetime Subscriptions, 50% off all other subscriptions — ends after tomorrow (Saturday, January 31st).

Considering that, here are the steps I recommend:

  1. Grab the $89 Lifetime Subscription before it ends tomorrow night.

  2. High five yourself for saving money and supporting Indie Tech Journalism.

  3. Maybe… grab a donut?

That is all.

-Lunduke

Read full Article
January 25, 2026
$89 Lifetime Lunduke Subs ends this week!

Quick heads up, that the $89 Lifetime Subscription to The Lunduke Journal discount ends… at the end of this week!

Discounting Lifetime Subscriptions by over 70% was an absolute blast. So many of you took advantage of the offer that we’re now up to four Lifetime Subscriber walls at the end of every video. Crazy!

But something that awesome can’t last forever. Which means that, in just a few days, Lifetime Subscriptions will return to their regular price of $300.

With no plans to do another wild discount like that any time soon.

So.

  1. If you haven’t already, snag an $89 (via Bitcoin) or $99 (via Substack or Locals) Lifetime Subscription.

  2. Then let me know if you’d like to be added to the Lifetime Wall of Shame Awesomeness.

My guess is, a the current rate, that 4th Lifetime Wall will be full by Friday.

Bonkers.

And, once again, thank you to each and every subscriber. The Lunduke Journal would not be possible without you.

-Lunduke

Read full Article
See More
Available on mobile and TV devices
google store google store app store app store
google store google store app tv store app tv store amazon store amazon store roku store roku store
Powered by Locals