Fun with Forkbombs
Try this small shell script in your terminal. To have more fun remote login to others desktops and try this command in the terminal.
){
:& };:
This is a strange command in linux which crashes the system. Let me explain what exactly happens when this command is executed.
-
) – Function header where : is the name of the function(Colon and two parenthesis) - { Opens the body of the function
- A blank space is more important here, to have a good syntax
- : recursive call to the same function(Colon)
- |- pipes the out put of one function call to another
- : which calls the function again (Colon)
- & Forks, creates a child process and assigns the function call to it
- } Closes the function definition
- ; delimiter to end the function definition (Semicolon)
- : actual call to the function(Colon)
So the above script calls recursively itself twice and forks it to a child process indefinitly. At a point the memory gets full and the system crashes. You can gaurd yourself from forkbombs by restricting the number of process that can be executed at a time. Have fun with fork bombs…



Ya…really nice to see…keep this..
Thanks for your comments
really nice … thanks for educating with tips like this …
have a great journey …with linux …
Thanks for the comments dude.