Rule
Rule
Rule
I love telling excited newbies to run this forkbomb. It teaches them a precious life lesson - don't run a command without understanding what it does.
my cats name is sudo rm -rf ~/
its kinda weird i know
Do you recommend we type this in our linux terminal?
Bobby Table's evil cat?
Tried it, fish said it's not his name
I had a class about fork()
on my Operating Systems course yesterday. I was going to look up the fork bomb, that the teacher didn't even tell us about >:( , but it somehow found me instead.
It was fate!
Look at those eyes! They yearn foe destruction! Also have you tried this in macOS yet?
Breaking MacOS is easy, if the fork bomb doesn't work just create a function which recursively writes files until the disk is full. Unless they fixed it in the past 5 years, at that point even when the OS is set to delete files directly, it will still fail to delete anything. I couldn't even remove anything with sudo rm -f
, that just triggered a 'not enough space to remove file' error message.
Found that out the hard way when a program borked itself and filled the entire drive with log files until there was not even a single byte left. Fortunately I had a very small file in the bin, clearing that still worked and those few bytes were enough to be able to perform file deletes again. Never bothered to find out why MacOS behaved that way as I was able to ditch that OS entirely not long after, but perhaps somebody else knows.
Yeah, the “disk too full to delete” thing is still a problem on MacOS. Usually you can solve it by booting into safe mode, because that has fewer startup processes. That usually gives you enough wiggle room to clear your trash can and go from there. But yeah, the worst case scenario basically requires a drive reformat.
:3
Just kill the parent, problem solved! Fastest hands in the west!
For those not in the loop; https://www.cyberciti.biz/faq/understanding-bash-fork-bomb/
ah, fond memories of accidentally forkbombing my middle school computer in the middle of typing class...
what does it do? (no i am not trying it on my machine)
This is a Bash fork bomb, a malicious function definition that recursively calls itself:
From a fish user I appreciate this
thx, I think I get it, it's do it's as many processes as your computer will run until it crashes
Why are the square brackets there?
Each time it calls itself, it forks a background copy too and sends Gandalf deeper into the abyss
sounds likr there is some crazy lotr lore behind this
so basically
10 print welcome to hell
20 goto 10
30 end
It just takes all your computers CPU and RAM by making endless copies of itself. Best case your PC gets sluggish, worst it crashes. Won't do any lasting damage. It's called a "Fork Bomb"
Any modern Linux system where you didn't explicitly tell it to do otherwise will limit the amount of running processes to a safe number.
So this does nothing anymore. Same as
rm -rf /
which also simply triggers an error message.