Fork Bomb

A fork bomb is a program which self replicates (forks) until system resources are exhausted.

Here is an example of a fork bomb written in Bash:

bomb(){
  bomb | bomb & 
}
bomb

In Bash it is allowed to use symbols for function names, so we can shorten the above snippet by renaming the name bomb to the colon symbol.

:(){
  : | : & 
}
:

We can then collapse the function into one line as allowed.

:(){ : | : & }
:

Lastly, we can collapse the two lines into one line using a semicolon.

:(){ : | : & }; :

Finally we can remove the whitespace.

:(){:|:&};:

Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to Linux Developer
Great! Next, complete checkout for full access to Linux Developer
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.