Results 1 to 4 of 4
Not that I want to actually do this, but what exactly does
:\(){ :\|:& };:
*do* to kick off a fork bomb? Just trying to better understand. I've escaped out ...
- 11-20-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 7
Bash fork bomb syntax meaning
Not that I want to actually do this, but what exactly does
:\(){ :\|:& };:
*do* to kick off a fork bomb? Just trying to better understand. I've escaped out a couple characters to prevent them from resolving as smiley faces in my post, but you get the idea of what I'm asking.
Thanks,
JeffLast edited by pgymjp; 11-20-2008 at 07:10 PM. Reason: clarification
- 11-20-2008 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
I don't think those backslashes should be there,they're just escape characters.
The colon is an alias for the true command. This is creating a function that splits off and runs itself again. By running asynchronously it continues to multiply at a geometric rate until all of the capacity of the machine is consumed. In modern systems this is prevented through use of ulimit which limits how many processes a user can have.
- 11-20-2008 #3Means that you're defining a function, and the function definition is between the curly braces.Code:
:(){};
The function definition,, means that the function first calls itself, and then passes the output to another version of itself, which is then backgrounded (that's what the & does).Code::|:&
After the function definition, the function is then called by using it's name, :.
The following,
would do the same thing except I've called the function "forkbomb", instead of the much harder to read ":".Code:forkbomb(){forkbomb|forkbomb&}; forkbombLast edited by smolloy; 11-20-2008 at 09:27 PM.
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode
- 12-23-2008 #4Just Joined!
- Join Date
- Dec 2008
- Posts
- 1
Fork bomb works like a champ
Thanks. Really works great when run by root. Now I have to break out the big hammer to get my AIX box back.


Reply With Quote
