[iyunv@localhost ~]# shutdown --help
Usage: shutdown [OPTION]... TIME [MESSAGE]
Bring the system down.
Options:
-r rebootafter shutdown
-h haltor power off after shutdown
-H halt after shutdown (implies-h)
-P poweroff after shutdown (implies -h)
-c cancela running shutdown
-k onlysend warnings, don't shutdown
-q,--quiet reduce output to errors only
2,示例1:
1
2
3
4
5
窗口1:[iyunv@localhost ~]# shutdown 23:30 #直接加时间指明某刻关机。
Broadcast message from root@localhost
(/dev/pts/2) at 22:56 ...
The system is going down for maintenance in34 minutes! #如果想取消也可以按Ctrl+C取消
shutdown: Shutdown cancelled ##在另外一个终端使用-c参数取消了
1
2
3
4
5
窗口2:[iyunv@localhost ~]#
Broadcast message from root@localhost
(/dev/pts/2) at 22:56 ...
The system is going down for maintenance in34 minutes! #窗口1命令引起的消息
[iyunv@localhost ~]# shutdown –c #在另外一个终端使用-c取消
3,示例2:
1
2
[iyunv@localhost ~]# shutdown 30 # The system is going down for maintenance in30 minutes!
[iyunv@localhost ~]# shutdown -r now # The system is going down for reboot NOW!