What is the shutdown command of centos7?

青灯夜游
Release: 2022-08-17 15:58:09
Original
21711 people have browsed it

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".

What is the shutdown command of centos7?

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.

What is the shutdown command of centos7?

Syntax

The syntax of this command is as follows:

shutdown [-t seconds] [-rkhncfF] time [message]
Copy after login

The options supported by this command are:

##-t secondsSend warning How many seconds to delay between message and deletion-kIt will not actually shut down the phone, it just sends a warning message to all users-r Restart, equivalent to -h Shut down and then stop -n Instead of using normal procedures to shut down, forcefully kill all running programs and then shut down by itself-cCancel shutdown-fDoes not execute fsck when restarting, CentOS system does not have it but Ubuntu system has it-FExecute fsck when restarting, the CentOS system does not have it but the Ubuntu system has it
Option Description
reboot
The parameters supported by this command are:

ParameterDescription##timenowmessagetime
Set the shutdown time . If it is , 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 parameter must be specified
Use

Shut down immediately

If you want to shut down immediately, you can execute the following command:

shutdown -h now
Copy after login

where

now

is equivalent to the state of time 0

immediately Restart

If you want to restart immediately, you can execute the following command:

shutdown -r now
Copy after login

Set the specified time to shut down

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>

Set to restart after specified minutes


# 语法
shutdown -r +m

# 示例:系统2分钟后重新启动
shutdown -r +2
Copy after login

m

means to shut down or turn on the computer after a few minutes.

Cancel the shutdown task

If you want to cancel the shutdown task, execute the following command:

shutdown -c
Copy after login

Send shutdown warning message

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"
Copy after login

What is the shutdown command of centos7?

What is the shutdown command of centos7?

FAQ

(1)

shutdown -h, shutdown -H and What is the difference between shutdown -P?

shutdown -H

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.

(2) Shutdown default operation enters single-user maintenance mode.

//十分钟后进入单用户维护模式
shutdown +10
Copy after login
Related recommendations: "

Linux Video Tutorial

"

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template