Use rm -rf with caution in linux

Note: You can't add "/" after the rm -rf command, otherwise it will delete all your system files, pay attention to it here!

 

If you have been in contact with Linux, you must have heard the story of rm -rf. What kind of effect will this terrifying command have after execution? Next, I will take you to demonstrate it in a virtual machine.

 

Note:: This command must not be executed in a production environment, otherwise there is no regret medicine to buy!

 

 

 

 

Therefore, it is necessary to develop good habits during the normal operation, try not to use the rm command, you can use the mv command instead. For example, if you want to delete a.txt, you can execute mv a.txt /mytemp, and then write a script to periodically clear the files in the /mytemp directory, which is much safer.

Guess you like

Origin blog.csdn.net/limiaoiao/article/details/84316667