2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-17 09:25:32 +00:00
cheat.sheets/sheets/_bash/forkbomb

12 lines
442 B
Plaintext
Raw Normal View History

2018-10-08 01:05:50 +00:00
# Forkbomb
# DO NOT RUN UNLESS YOU WANT YOUR COMPUTER TO CRASH
2018-10-08 10:10:06 +00:00
#
2018-10-08 01:05:50 +00:00
# This defines a function named ':' that calls itself, pipes its output back to
# itself, and runs that in the background. the ';:' at the end terminates the
# function definition and then calls the function to begin the chain reaction.
# A very nasty trick, indeed.
:(){ :|: & };:
# A more-readable version of the fork bomb could be written as:
FORK(){ true | true & }; FORK