Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Anyone understand the following code , running in bash ?

:(){ :|:& };:

It seems to be a "fork" bomb on Linux.

share|improve this question
add comment

1 Answer

up vote 16 down vote accepted

It's not that difficult to decipher in fact.

This piece of code just defines a function named : which calls two instances of itself in a pipeline: :|:&. After the definition an instance of this function is started.

This leads to a fast increasing number of subshell processes. Unprotected systems (systems without a process number limit per user) will be severely affected by such fork bombs since legitimate processes will quickly be outnumbered and thus deprived of most CPU resources.

share|improve this answer
2  
Which OS is not protected against this? –  Ali Dec 25 '11 at 22:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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