The Nerdy Sixty | (28/60) Fork Bomb | Solution

There’s a notorious shell one-liner `:(){ :|:& };:`. What does it do (and why should you NOT run it)?

Hint 1: It defines a function `:` that calls itself twice, creating an exponential process fork.

Hint 2: It will spawn processes indefinitely (a fork bomb), exhausting system resources.

 

Solution:

The code `:(){ :|:& };:` is a fork bomb in Bash. It defines a function `:` that calls itself twice (`:|:`) and backgrounds those calls, rapidly forking processes. If executed, it will quickly consume all system resources and likely freeze/crash the system. (Do NOT run it.)

 

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Cookie Notice by Real Cookie Banner