Linux study notes - shutdown and restart command

  

1. Shutdown command:

1) "shutdown -h now" Shut down immediately (h is the meaning of halt); 2) "shutdown -h 10" Shutdown after 10 minutes; 3) "shutdown -h 05:30" Shutdown at 05:30 (5:30); 4) "poweroff" Shut down immediately; 5) "halt" Shut down immediately; 6) " ;init 0" Shut down immediately; 7) "shutdown -c" Cancel the previous shutdown or restart command (c means cancel). 

2. Restart command:

1) "shutdown -r now" Restart now (r is the meaning of reboot); 2) "shutdown -r 05:30" at 05:30 (five Half point) restart; 3) "reboot" restart now; 4) "init 6" Restart now. 

Special note:

1) "shutdown" The command must be used by the root user, other users do not have permission; 2) The "shutdown" command can send warning messages to all users, for example: " Shutdown -r 10 I need to restart the system. "3) "shutdown" The command will save the running service in the system when it is shut down or restarted, so the "shutdown" command is safe. (Other orders on the Internet say that it is safe and some say it is not safe. When I look at the commands under the "sbin" directory, I find that these commands are soft links and point to the same file. So I don't comment on other commands for the time being. After I figure it out, I will add it again. But for the sake of insurance, when you shut down or restart under "root", it is best to use the "shutdown" command.
Copyright © Windows knowledge All Rights Reserved