【问题标题】:What would this command do if run in UNIX?如果在 UNIX 中运行,这个命令会做什么?
【发布时间】:2012-07-18 03:14:47
【问题描述】:

我在某处看到这个命令,:(){ :|:& };:

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

【问题讨论】:

    标签: unix command forum


    【解决方案1】:

    这是fork bomb,非常糟糕。

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

    【讨论】:

    • 是的,它与forkbomb(){ forkbomb|forkbomb & } ; forkbomb 相同,但函数被称为: 而不是forkbomb
    【解决方案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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-19
      • 1970-01-01
      • 2012-09-21
      • 1970-01-01
      • 2015-05-21
      • 2018-01-23
      相关资源
      最近更新 更多