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