IT袋

当前位置:主页 > 对比评测 >

linux重启命令区别

linux重启命令区别 分享linux入门基础教程(2)

更新:2023-08-29 08:48:10 来源:IT袋 作者:苏晓敏
导读:linux重启命令区别,另外我们可以使用带有 -halt 选项的 shutdown 命令来立即关闭设备。 # shutdown halt now 或者 # shutdown -H now -H, halt:停止设备运行 另外我们可以使用带有 powerof

linux重启命令区别

另外我们可以使用带有 -halt 选项的 shutdown 命令来立即关闭设备。

# shutdown –halt now

或者

# shutdown -H now

-H, –halt:停止设备运行

另外我们可以使用带有 poweroff 选项的 shutdown 命令来立即关闭设备。

# shutdown –poweroff now

或者

# shutdown -P now

-P, –poweroff:切断电源(默认)。

如果您没有使用时间选项运行下面的命令,它将会在一分钟后执行给出的命令。

# shutdown -h

Shutdown scheduled for Mon 2018-10-08 06:42:31 EDT, use ‘shutdown -c’ to cancel.

root@2daygeek.com#

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 06:41:31 EDT):

The system is going down for power-off at Mon 2018-10-08 06:42:31 EDT!

其他的登录用户都能在中断中看到如下的广播消息:

[daygeek@2daygeek.com ~]$

Broadcast message from root@2daygeek.com (Mon 2018-10-08 06:41:31 EDT):

The system is going down for power-off at Mon 2018-10-08 06:42:31 EDT!

对于使用了 -halt 选项:

# shutdown -H

Shutdown scheduled for Mon 2018-10-08 06:37:53 EDT, use ‘shutdown -c’ to cancel.

root@2daygeek.com#

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 06:36:53 EDT):

The system is going down for system halt at Mon 2018-10-08 06:37:53 EDT!

对于使用了 -poweroff 选项:

# shutdown -P

Shutdown scheduled for Mon 2018-10-08 06:40:07 EDT, use ‘shutdown -c’ to cancel.

root@2daygeek.com#

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 06:39:07 EDT):

The system is going down for power-off at Mon 2018-10-08 06:40:07 EDT!

可以在您的终端上敲击 shutdown -c 选项取消操作。

# shutdown -c

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 06:39:09 EDT):

The system shutdown has been cancelled at Mon 2018-10-08 06:40:09 EDT!

其他的登录用户都能在中断中看到如下的广播消息:

[daygeek@2daygeek.com ~]$

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 06:41:35 EDT):

The system shutdown has been cancelled at Mon 2018-10-08 06:42:35 EDT!

添加时间参数,如果你想在 N 秒之后执行关闭或重启操作。这里,您可以为所有登录用户添加自定义广播消息。例如,我们将在五分钟后重启设备。

# shutdown -r +5 “To activate the latest Kernel”

Shutdown scheduled for Mon 2018-10-08 07:13:16 EDT, use ‘shutdown -c’ to cancel.

[root@vps138235 ~]#

Broadcast message from root@vps.2daygeek.com (Mon 2018-10-08 07:08:16 EDT):

To activate the latest Kernel

The system is going down for reboot at Mon 2018-10-08 07:13:16 EDT!

相关阅读