4 ms·
> Now if you really want to screw over your machine, the classic bash fork bomb is `:(){ :|:& };:` Actually, you're wrong. At least on a mac (IIRC) it caps the
by duaneb 14y ago
> Now if you really want to screw over your machine, the classic bash fork bomb is `:(){ :|:& };:`
Actually, you're wrong. At least on a mac (IIRC) it caps the process number so fork bombs just fill the console with errors. I'm sure you can get around it but that kind of defeats its simplicity.
EDIT: I mean, don't get me wrong, it still really bogs your computer down, but you can still kill the parent bash process in a few seconds.
- ninetax 14y agoCrashed my machine running linux Mint. I couldn't Google it, so I had to try it. I don't know what I expected. Can someone explain how it works?
- gcr 14y agoBe careful running commands that you don't understand! I've been bitten by that before...
- duaneb 14y agoI don't know about linux (and I really should in this case as it's my 'field'), but at least on mac, you can restrict the number of child processes a process can spawn with `ulimit -u`: zooey:~ duane$ ulimit -u 709
- cheeseprocedure 14y agoThis is a very nice breakdown: http://www.cyberciti.biz/faq/understanding-bash-fork-bomb/ http://www.cyberciti.biz/faq/understanding-bash-fork-bomb/
- eridius 14y agoDepends on how much RAM you have. If your machine swaps everything out to disk before it hits the process limit, then you're pretty screwed anyway.