shutdown是最安全的关机和重启命令,平时使用时推荐使用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
以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !