Linux命令之shutdown

shutdown [选项] [时间] [通知消息](可以为空,但必须有参数和时间)

系统关机命令,所有登录用户都可看到关机信息。

(1).常用选项

-c 取消已经在进行的shutdown指令内容

-h 关机

-k 发送警告信息给所有登录者

-r 重启

(2).unbuntu独有参数,CentOS没有参数

-f 重启后强制略过fsck磁盘检测

-F 重启后强制进行fsck磁盘检测

(3).实例

特定时间执行关机命令

shutdown –h now             //立即关机
shutdown –h 12:00           //在12:00关机

指定五分钟后关机,并发出警告信息

[root@CentOS6 桌面]#shutdown +5 “This System will be shutdown in 5 minutes”
Broadcast message from root@CentOS6.8
                   (/dev/pts/0) at 13:33 …

The system is going down for maintenance in 5 minutes!                 //系统提醒
This System will be shutdown in 5 minutes                                            //用户自定义提醒

指定3分钟后重启,并发出警告信息

[root@CentOS6 桌面]#shutdown –r +3 “3分钟后关机重启”
Broadcast message from root@CentOS6.8
                   (/dev/pts/0) at 13:53 …

The system is going down for reboot in 3 minutes!          //系统提醒
3分钟后关机重启                                              //用户自定义提醒

给所有登录用户发送提醒

[root@CentOS6 桌面]#shutdown –k “Waring:maybe the system will be shutdown”
Shutdown:time expected
Try’shutdown --help’ for more information.
[root@CentOS6 桌面]# shutdown –k 5 “Waring:maybe the system will be shutdown”
[root@CentOS6 桌面]#
Broadcast message from root@CentOS6.8
                   (/dev/pts/0) at 14:26 …

The system is going down for maintenance in 5 minutes!
Waring:maybe the system will be shutdown

  

转载于:https://www.cnblogs.com/diantong/p/8573796.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值