如果在UNIX中运行,该命令会起什么作用?

时间:2012-07-18 03:14:47

标签: unix command forum

我看到此命令发布在某个地方,:(){ :|:& };:

如果我在UNIX中运行它会怎么做?我不想尝试自己,以防它做坏事

2 个答案:

答案 0 :(得分:4)

这是一个fork bomb,非常糟糕。

它会产生许多进程,随着每个进程产生两个进程,数量呈指数级增长。它们会阻塞你的系统,直到它崩溃。

答案 1 :(得分:2)

不要运行它。它的叉炸弹。它会打倒你的系统。

来自维基百科:

 /- Define the function ':' without any parameters '()' as follows:
 | /- Beginning of function-block.
 | | /- Load a copy of the function ':' into memory ...
 | | |/- ... and pipe its output to ...
 | | ||/- ... another copy of the ':'-function, which has to be loaded into memory.
 | | |||   (In other words, ':|:' loads two more copies of ':', thus causing a chain-reaction)
 | | |||/- Disown the functions (make them a background process), so that the children of a parent
 | | ||||  will not be killed when the parent gets auto-killed.
 | | |||| /- End of function-block.
 | | |||| |/- End of definition. 
/-\| |||| ||/- Execute the function ':'.  The chain-reaction begins.
:(){ :|:& };:

以下是链接http://en.wikipedia.org/wiki/Fork_bomb