To shut down the Linux Command, you must first switch to the root user.
1. Direct Shutdown
Shutdown-H now
2. Shut down in three minutes
Shutdown-H + 3 [+ 3] indicates shutdown in three minutes
3. Shut down in three minutes and display the information to the user
Shutdown-H + 3 "system will shutdown after 3 minutes"
4. commands for directly restarting the computer
Shutdown-R now. Similarly, restart after three minutes, with the message: shutdown-R + 3 "system will restart after 3 minutes"
5. Command for shutdown at the specified time
Shutdown-H. indicates that the computer will be shut down. Similarly, you can add a prompt.
6. Specify the shutdown time and place it in the background for execution.
Since the computer is too early to shut down, we still need to do other work. Therefore, you can place it in the background for execution. You only need to add the "&" symbol after it.
For example:
Zhangzhiwei @ Ubuntu :~ $ Sudo shutdown-H: 00 "system will shutdown "&
[1] 14624
The output 14624 indicates the ID of the shutdown process. If you want to cancel shutdown, kill it. Example: Kill 14624