Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Development without rm-rf / * is not good for operation and maintenance.

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

It takes about 1 minute to read this article.

Open the terminal, get root permissions, and execute the following command: rm-rf / *. What happens? It is estimated that as long as people who have come into contact with Linux, they must have heard a lot about it and know what terrible things will happen after that.

Popular science, run the command in the Linux system, the system will faithfully execute the command, even if the result is to delete itself, do not execute the secondary command in the production environment, otherwise there is no regret medicine to buy!

Delete command for "rm" Linux system

A parameter under the "- r" rm command that refers to recursive deletion

A parameter under the "- f" rm command that forcibly deletes

"/ *" / 'represents the system root directory, and' / * 'represents any file under the system root directory

1. During the execution of the command, some errors will be reported, indicating that files with special permissions cannot be deleted (protected by the system, perhaps I permission), but this will not hinder the execution of the command.

two。 After executing the command, the commands such as top, free, ls, etc. used in the terminal will be invalid, the / bin directory will also be delete, and only cd will be available.

3. In addition, the Linux system will not shut down properly, and the commands related to the shutdown operation have also been deleted.

4. After the forced shutdown, try to boot again, can not enter the system normally again, can only reinstall the system.

Judging from the above results, even the basic commands cannot be executed, so the user data (such as installed software, deployed websites, databases, etc.) must have been deleted.

Therefore, we should form a good habit in the process of operation, try not to use the rm command, use the mv command instead. For example, to delete the abc.txt file, execute mv abc.txt / temp, and then write a script to regularly clean up the files in the / temp directory, which is much safer.

END

The growth path of programmers

Although it is a long way to go, it will come.

This article was originally posted on the Wechat official account "the way programmers grow up" and replied "1024". You know, give me a like.

Wechat ID:cxydczzl

A wonderful review of the past

Programmers take advantage of seven platforms for private work.

The growth path of Java programmers

Why does vernacular TCP need three-way handshake

50 details of Java performance Optimization (Precious Edition)

Design the coupon system of e-commerce platform

A conversation makes you understand what an architect does.

Teach you a coquettish operation to improve efficiency with IDE programming!

A gift package of classic e-books for programmers

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report