What Is a fork bomb ?
A fork bomb is a piece of code which calls for itself more that twice while running. Thus when executed , the code will call for itself twice then both the calls would call for itself twice thus creating thousands of copies of itself in second’s
. which in term crashes the system .
A fork bomb is a piece of code which calls for itself more that twice while running. Thus when executed , the code will call for itself twice then both the calls would call for itself twice thus creating thousands of copies of itself in second’s
. which in term crashes the system .
Below is a fork bomb code :
:(){ :|: & };:
What does those bunch of random characters stand for ?
:() means you are defining a function called :
:() means you are defining a function called :
{:|: &} means run the function : and send its output to the : function again and run that in the background.
The ; is a command separator, like &&.
: runs the function the first time.
Essentially you are creating a function that calls itself twice every call and doesn’t have any way to terminate itself. It will keep doubling up until you run out of system resources.
Happy coding!