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
40% of LinkedIn (& Sneako) Publishing AI Generated Posts

Dead. Internet. Theory. It's real.

NeXTStep, Emacs, Desqview/X, & TRS-80 Model 100 Walls:
https://lunduke.locals.com/post/8056105/trs-80-model-100-joins-the-lunduke-journal-lifetime-wall-party

Get on The Wall with a Massively Discounted Lifetime Sub:
https://lunduke.substack.com/p/50-off-yearly-and-massively-discounted

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

00:15:02
The Lunduke Linux Distro - No Age Verification, No AI, No Weird Politics

The Lunduke Computer Operating System has No Systemd, No Forced Rust Clones, & a "Code of Ethics" quoting the Bible.

The Lunduke Computer Operating System:
https://github.com/BryanLunduke/LCOS

NeXTStep, Emacs, Desqview/X, & TRS-80 Model 100 Walls:
https://lunduke.locals.com/post/8056105/trs-80-model-100-joins-the-lunduke-journal-lifetime-wall-party

Get on The Wall with a Massively Discounted Lifetime Sub:
https://lunduke.substack.com/p/50-off-yearly-and-massively-discounted

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

00:25:45
NeXTStep, Desqview/X, & TRS-80 Model 100 Walls!

The Lunduke Journal now has close to 20 retro computer themed walls, filled with the names of subscribers. And that number is growing fast.

NeXTStep, Emacs, Desqview/X, & TRS-80 Model 100 Walls:
https://lunduke.locals.com/post/8056105/trs-80-model-100-joins-the-lunduke-journal-lifetime-wall-party

Get on The Wall with a Massively Discounted Lifetime Sub:
https://lunduke.substack.com/p/50-off-yearly-and-massively-discounted

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

00:14:16
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

Some age verification commentary... I wonder if the question, Who is it enforced against? will ever be answer (the guy seems to imply it is commercial distributors, for the Cal law)
Anyway, it will be interesting to double check and revisit where things are.

20 hours ago

AI Chief of Staff

Wouldn’t it be nice to have a Chief of Staff?

Someone who remembers everything, so you don’t have to.
• Someone who starts each day by telling you what actually matters.
• Someone who keeps projects from falling through the cracks.
• Someone who turns big goals into today’s next three actions.
• Someone who protects your attention as carefully as your calendar.
• Someone who keeps your life moving forward, even when you have too many competing priorities.

This and more can be done by today’s agent systems - I use Codex for mine as so much of what I do is building software in Codex. I am pretty sure Hermes and OpenClaw are quite suitable as well.

The important part is your mindset - not so much the tech. I treat AI as an endless pool of advisors I can craft into being. I’m in the middle of a job search and launching a consulting business (whichever lands first) and I have a lot of balls juggling in the air. Thus I called forth a chief of staff and I talk to him ...

11 hours ago

What's in your computers cellar???

post photo preview
TRS-80 Model 100 joins The Lunduke Journal Lifetime Wall party!

Buckle up, Buttercup. Because The Lunduke Journal is about to blow your mind.

  1. The “BeOS” Wall Lifetime Subscriber Wall is now full (see all of them on Lunduke.com)!

  2. We’ve added a new “TRS-80 Model 100” Wall (because we can)! That’s the 19th Lifetime Subscriber Wall! 19!

  3. The discounted Lifetime Lunduke Journal Subscriptions are still available through to the end of this month (July).

Which means there are, as of this exact moment, 4 Walls with space available (see Lunduke.com for the full list of Walls). But these fill up wicked fast.

  1. Emacs (only a few spots left)

  2. Desqview/X (a little less than 2/3rd’s full)

  3. NeXTStep (still plenty of space)

  4. TRS-80 Model 100 (just launched)

 

Nice, right?

Worth noting: The “TRS-80 Model 100” has very limited screen resolution (240 x 64), which means only a small number of names can fit on that wall. If you want on it, I’d let me know right away.

Grab a discounted Lifetime Subscription (if you don’t already have one), then let me know (email “bryan at lunduke.com”) which Wall you’d like to see your name on.

Huge high five to everyone who has already added their name to a Wall. At the current rate, we’ll have over 20 retro computer themed walls, filled with all of your names, by the end of the month.

And, doggone it, that’s amazing.

-Lunduke

Read full Article
Vim beats Emacs!

Well, we’ve done it.

We’ve answered the eternal question: “Which Lunduke Journal Lifetime Subscriber Wall would fill with names quicker? Emacs or Vim?”

The answer, it turns out, is “Vim”. And it takes just 8 days.

 

A hearty “Thank You” to everyone who supports The Lunduke Journal by getting Lifetime Subscriptions (massively discounted throughout July) and getting on these walls! You make all of this possible!

Now. How long will it take for Emacs to fill up (matching the same number of names as the Vim Wall)?

Well, right now the Emacs Wall is a hair over 2/3rds of the way full. So we’ll find out!

Welcome NeXTStep Wall!

With the closing of the “Vim” Wall (and the BeOS Wall only having the space for 1 name left), now seemed like a good time to add a new retro computer wall: The NeXTStep 1.0 Wall.

Right now, there are 4 Walls available to add your name to (*cough* massive discount *cough*).

  • NeXTStep (just opened)

  • Emacs (about 2/3rds full)

  • BeOS R5 (1 spot left)

  • Desqview/X (1/2 full)

 

Once again, huge thanks to everyone who supports The Lunduke Journal!

-Lunduke

Read full Article
Lunduke's Week in Tech : June 28 - July 4, 2026

Lunduke’s Thoughts of The Week

Yesterday was the 4th of July.

As such, time that I normally would have spent writing up some thoughts on the Tech News of the Week (tm) was, instead, spent eating hamburgers, watching fireworks, and generally goofing off with my kids.

So allow me to briefly summarize my thoughts using as little effort as possible:

Rust is weird, Sony sucks, and America is awesome.

… Yup. That just about covers it.

I hope all of my fellow Americans had a truly splendid Independence Day.

Biggest Tech Stories - June 28 - July 4, 2026

Here are the major stories from the last week, with direct links to X and Substack.

See Lunduke.com for all other platforms (Rumble, RSS Audio Podcast, etc.).

  • Git Takes Another Step Towards Making Rust Mandatory (X, Substack)

  • 74 Million User Accounts Exposed in Breaches During June (X, Substack)

  • BCacheFS Adding Rust Dependency Even Though “Rust doesn’t have a stable ABI” (X, Substack)

  • Git Without Rust From Dev of XLibre (X, Substack)

  • Sony Says No More Physical PlayStation Games (X, Substack)

  • Ubuntu Sponsors Rust Clone Foundation (X, Substack)

  • Like Computers? Thank America. (X, Substack)

Huge thank you to all of The Lunduke Journal’s subscribers. You make all of this possible.

-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