John Goofy John Goofy - 4 months ago 9
Linux Question

Does a bash fork bomb lives forever?

According to Wikipedias lemma about a fork bomb, especially if Bash is used, I want to know what happens if I would execute this code in my Bash and immedeatly or after some seconds power off the machine.

Would the fork bomb be still alive if I restart the machine?

Or would have this fork bomb something seriously damaged?

Or is this kind of fork bomb just an academic issue?

Answer

In relation to the bash fork bomb

#!/bin/bash
$0|$0& #"$0" returns the name of the shell script itself

Would the fork bomb be still alive if I restart the machine? No

Or would have this fork bomb something seriously damaged? No, it's meant to overload your system, which it does pretty quickly.

Or is this kind of fork bomb just an academic issue? No, hackers use it to overload the system and make the system 'useless'.