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.)

Leave a Reply