This article introduces the shutdown syntax and details of the Linux shutdown (restart) command. Shutdown is the safest command to shut down and restart. We recommend that you use the shutdown command to shut down and restart your system.
Shutdown
[Syntax] shutdown [Options] [parameters]
[Details] shutdown is the safest command to shut down and restart. We recommend that you use the shutdown command to shut down your system during normal use. In addition, this command supports scheduled operations.
[Option]
Option corresponding function-a specify permission-r restart calculator (same as reboot) command-k simulate Shutdown (only sends a warning message to the user but does not shut down)-HShut down the computer and power off (commonly used)-n do not call the init process to shut down the computer (not recommended)-c cancel the command being executed-f restart the computer, however, do not perform disk detection-F restart the computer and perform disk detection-t (s) specify the number of seconds to delay sending and deleting information
[Additional parameters]
ParametersIntroduction
Time refers to the time when the computer is disabled.
It can be a detailed time, such.
It can also be used as a detailed minute, for example, "+ 5", then shut down after 5 minutes. Warning information can be any text, which must be enclosed in quotation marks.
Example:
(1) run the shutdown command to restart the computer (add now to restart the computer immediately)
shutdown -r now
(2) set to shut down the computer one minute later, and prompt "1 minute after shutdown" in SSH"
shutdown -h +1 "1 minute after shutdown"
(3) Cancel Shutdown
To cancel shutdown and restart, press Ctrl + C to cancel the command being executed in SSH. Of course, if you log on to SSH again or in other cases, you can use the code to cancel (timed) shutdown.
shutdown -c