Linux Study Notes-Shutdown and restart commands
1. shutdown command:
1) "shutdown-h now" shut down immediately (h indicates halt); 2) "shutdown-h 10" shut down after 10 minutes; 3) "shutdown-h half past five" shutdown at (); 4) "poweroff" shutdown immediately; 5) "halt" shutdown immediately; 6) "init 0" shutdown immediately; 7) "shutdown-c" cancels the previous shutdown or restart command (c Indicates cancel ).
2. Restart command:
1) "shutdown-r now" restart immediately (r indicates reboot); 2) "shutdown-r half past five" at (); 3) "reboot" restart now; 4) "init 6" restart now.
Note:
1) The "shutdown" command must be a root user, and other users do not have the permission; 2) the "shutdown" command can send a warning message to all users, for example: "shutdown-r 10 I need to restart the system."; 3) when the "shutdown" command is shut down or restarted, the services running in the system will be saved first, therefore, the "shutdown" command is safe. (Some Other commands on the Internet are secure, others are insecure. When I view the commands under the "sbin" directory, I find that these commands are soft links, and points to the same file. Therefore, other commands are not evaluated for the time being. And then try again. For the sake of insurance, we recommend that you use the "shutdown" command when shutting down or restarting the instance under "root ).