Linux Fork Bomb parsing--linux Fork Bomb

Source: Internet
Author: User

Linux Fork Bomb

:() {: |: &}: is a bash function, known as fork Bomb, is a Linux system that denies service attacks. If you are curious to carry out this command, then quickly restart the system!

Command parsing
:(){    : | : &};:
    1. : Here is a function name, which we define, and execute it later.
    2. :|:&: The output of the function is passed through the pipeline to another colon function as input and executed in the background.
    3. { }; Identifies the content inside as a function body.
    4. last one: the function executes once the definition is complete.
Principle Analysis
  1. The first thing to note is that it is a shell built-in command, so the above code is only likely to produce a fork bomb in bash, because in some other shells, built-in commands have precedence over functions, so execute :always execute built-in commands. (: is an empty command, while true is equivalent to while :, commonly used as a placeholder)
  2. Let's take a look at the main body of the function :|:&, when using a pipeline, two processes start executing at the same time.
  3. So when executing a:function, two new processes are generated, and then an original process exits, so that the recursion continues, resulting in an infinite recursion. In line with this growth model, its growth trend is about < Span class= "Mrow" id= "mathjax-span-2" > 2 n Span style= "Display:inline-block; width:0px; Height:2.349em; " > 。
Summarize

There are many more commands for this trap in Linux, which is why I like Linux and is full of exploration.

Feedback and Suggestions
    • Weibo: @AnSwEr not the answer
    • Github:answerywj
    • Blog: answer is not the answer column

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux Fork Bomb parsing--linux Fork Bomb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.