Possible Duplicate:
What does this cryptic bash command mean?

Why this command crashes Linux?

:(){ :|:& };: 
link|improve this question

76% accept rate
2  
It doesn't crash a properly configured Linux - it just uses up the processes of the current user (which you really should limit for all but root) – Majenko Mar 20 '11 at 9:05
3  
Also, for all those who are reading this: DO NOT RUN THIS COMMAND. – Wuffers Mar 20 '11 at 14:28
feedback

closed as exact duplicate by MaQleod, BloodPhilia, grawity, Sathya Mar 20 '11 at 15:11

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

4 Answers

up vote 7 down vote accepted

This is called a fork bomb.

link|improve this answer
feedback

The command defines a function named :, which, when called, spawns two copies of itself in the background and exits. Those two copies do the same, resulting in a huge amount of processes in just a second, continuing indefinitely.

Below is exactly the same function but with a more readable name:

foo() {
    foo | foo &
}

foo
link|improve this answer
can u give a bit more explanation to decipher :(){ :|:& };: – darthvader Mar 20 '11 at 8:39
2  
@iJeeves: I did. It's in the post. – grawity Mar 20 '11 at 8:40
Where he writes foo replace it with : – adamo Mar 20 '11 at 13:35
feedback

Technically speaking the system has not crashed. A system crash produces an exit with errors. It neither has hanged. This would imply that the system is doing something and has not returned. In the particular case it is working properly. It just takes too long to respond because a computer realization has finite resources. Hence infinite processes and finite resources result in infinite time to respond.

link|improve this answer
could you please explain the downvote? I am just arguing that this is in fact the wrong question because as noted above having restricted the user resources this would not produce any problem. Hence this is not intrinsic to the linux / unix system but a result of mal-administration. – g24l Mar 20 '11 at 14:28
feedback

It forks processes to background endlessly. After a while, there is too many processes, each taking small amount of system resources.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.