centos7 shutdown command is "shutdown". The shutdown command can be used to shut down the system and send a message to all users before shutting down. It can also be used to restart the system. The syntax is "shutdown [-t seconds] [-rkhncfF] time [message]"; for example, to shut down immediately use "shutdown - h now", restart immediately with "shutdown -r now", and shut down at a specified time with "shutdown -h hours:minutes".
The operating environment of this tutorial: CentOS 7 system, Dell G3 computer.
centos7 shutdown command is "shutdown".
shutdown
The command can be used to shut down the system and send a message to all users before shutting down. It can also be used to restart the system.
The syntax of this command is as follows:
shutdown [-t seconds] [-rkhncfF] time [message]
The options supported by this command are:
Option | Description |
---|---|
Send warning How many seconds to delay between message and deletion | |
It will not actually shut down the phone, it just sends a warning message to all users | |
Restart, equivalent to | reboot
|
Shut down and then stop | |
Instead of using normal procedures to shut down, forcefully kill all running programs and then shut down by itself | |
Cancel shutdown | |
Does not execute fsck when restarting, CentOS system does not have it but Ubuntu system has it | |
Execute fsck when restarting, the CentOS system does not have it but the Ubuntu system has it |
Description | |
---|---|
Set the shutdown time . If it is | now, it means shutting down immediately; if it is number , it means shutting down the system after specified minutes; if it is hour:minute , it means shutting down the system at the specified time of day (24 hours Control) Shut down the system
|
A warning message sent to all users. If this parameter is specified, the | time parameter must be specified
|
If you want to shut down immediately, you can execute the following command:
shutdown -h now
where
now is equivalent to the state of time 0
If you want to restart immediately, you can execute the following command:
shutdown -r now
If you want to set the current server To automatically shut down at a specified time, you can set the time. The time format is:
hour:minute. The command format is as follows: <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"># 语法
shutdown -h 小时:分钟
# 示例,晚上十点半自动关机
shutdown -h 22:30</pre><div class="contentsignin">Copy after login</div></div>
# 语法
shutdown -r +m
# 示例:系统2分钟后重新启动
shutdown -r +2
means to shut down or turn on the computer after a few minutes.
If you want to cancel the shutdown task, execute the following command:
shutdown -c
If you want to shut down after 5 minutes and want to send a warning message to all logged in users that they will shut down in 5 minutes, you can do this:
shutdown +5 "System will shutdown after 5 minutes"
shutdown -h, shutdown -H
and What is the difference between shutdown -P
?
is a shutdown operation, which stops the system from running but does not turn off the power supply. shutdown -P
It is a power-off operation. shutdown -h
chooses whether to turn off the power according to the system's default settings. Turning off the power will send an ACPI command to notify the PSU (Power Supply Unit) power supply.
//十分钟后进入单用户维护模式
shutdown +10
The above is the detailed content of What is the shutdown command of centos7?. For more information, please follow other related articles on the PHP Chinese website!