1.立即重启命令
方法1:
[root@itbkz ~]# init 6
方法2:
[root@itbkz ~]# reboot
方法3:
[root@itbkz ~]# shutdown -r now
正常重启,运行的服务停止后在重新启动,推荐使用
2.立即关机命令
方法1:
[root@itbkz ~]# init 0
方法2:
[root@itbkz ~]# shutdown now
正常关机,运行的服务停止后在关机,推荐使用
[root@itbkz ~]# poweroff
立刻强制关机,相关于断电,不建议使用
[root@itbkz ~]# shutdown-hnow
立刻关机,root用户使用,不建议使用
[root@itbkz ~]# halt
强制关机 (虚拟机使用这个命令就出现异常,卡在那关不了机,提示CPU被禁用了,不能使用),强烈不建议使用
3.延时重启命令
[root@itbkz ~]# shutdown -r 3
Shutdown scheduled for 二 -07-21 16:09:27 CST, use 'shutdown -c' to cancel.
[root@itbkz ~]#
Broadcast message from root@ (Tue -07-21 16:06:27 CST):
The system is going down for reboot at Tue -07-21 16:09:27 CST!
主机将在3分钟之后重启
4.延时关机命令
[root@itbkz ~]# shutdown
Shutdown scheduled for 二 -07-21 15:41:25 CST, use 'shutdown -c' to cancel.
[root@itbkz ~]#
Broadcast message from root@ (Tue -07-21 15:40:25 CST):
The system is going down for power-off at Tue -07-21 15:41:25 CST!
主机将在1分钟之后关机
[root@itbkz ~]# shutdown -h 10
Shutdown scheduled for 二 -07-21 15:51:56 CST, use 'shutdown -c' to cancel.
[root@itbkz ~]#
Broadcast message from root@ (Tue -07-21 15:41:56 CST):
The system is going down for power-off at Tue -07-21 15:51:56 CST!
主机将在10分钟后关机
5.定时重启
[root@itbkz ~]# shutdown -r 16:03
6.定时关机
[root@itbkz ~]# shutdown -h 16:03
7.取消延时关机/重启
[root@itbkz ~]# shutdown -c
[root@itbkz ~]#
Broadcast message from root@ (Tue -07-21 15:45:39 CST):
The system shutdown has been cancelled at Tue -07-21 15:46:39 CST!
8.注销命令
[root@itbkz ~]# logout
注销命令,只能使用在命令行,对图形界面无效。
IT博客站版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Linux系统关机重启相关命令