Home >Computer Tutorials >Computer Knowledge >Detailed explanation and examples of Linux Centos7 shutdown command!

Detailed explanation and examples of Linux Centos7 shutdown command!

WBOY
WBOYforward
2024-03-06 14:30:05844browse

Linux Centos7关机命令详解及示例!

Centos means community enterprise operating system in Chinese. It is one of the Linux distributions. It is a free, open source, and redistributable open source operating system. It is also highly used. One of the systems. So what is the Linux
Centos7 shutdown command? The following is an introduction to the specific content.

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

grammar

The syntax of this command is as follows:

shutdown [-t seconds][-rkhncfF]time[message]

The options supported by this command are:

 -t seconds How many seconds to delay between sending a warning message and deleting the message

 -k does not actually shut down the computer, it just sends a warning message to all users

 -r Restart, equivalent to reboot

 -h Stop after shutdown

 -n does not use normal procedures to shut down, but uses a forced method to kill all running programs and then shut down itself

 -c Cancel shutdown

 -f does not execute fsck when restarting, centos system does not have it but Ubuntu system has it

 -F executes fsck when restarting, the centos system does not have it but the Ubuntu system has it

The parameters supported by this command are:

 time
Set the shutdown time. If it is now, it means shutting down immediately; if it is number, it means shutting down the system after the specified minute; if it is hour:minute, it means shutting down the system at the specified time of the day

 message A warning message sent to all users. If this parameter is specified, the time parameter must be specified

use

Shut down immediately

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

Restart now

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

shutdown -r now

Setting 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: hours: minutes. The command format is as follows:

#grammar

shutdown -h hours:minutes

 #Example, automatic shutdown at 10:30 pm

 shutdown -h 22:30

The above is the detailed content of Detailed explanation and examples of Linux Centos7 shutdown command!. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete