詳解 linux中的關機和重啟命令
一 shutdown命令
shutdown [選項] 時間
選項:
1
2
3
|
-c:取消前一次關機命令 -h:關機 -r:重啟 |
二 shutdown實戰
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
[root@localhost tmp]# date sat jul 15 09:28:35 cst 2017 [root@localhost tmp]# shutdown -r 05:30 shutdown scheduled for sun 2017-07-16 05:30:00 cst, use 'shutdown -c' to cancel. [root@localhost tmp]# shutdown -r 05:30 & [1] 4936 [root@localhost tmp]# shutdown scheduled for sun 2017-07-16 05:30:00 cst, use 'shutdown -c' to cancel. broadcast message from root@localhost.localdomain (sat 2017-07-15 09:30:00 cst): the system is going down for reboot at sun 2017-07-16 05:30:00 cst! ^c [1]+ done shutdown -r 05:30 [root@localhost tmp]# shutdown -c broadcast message from root@localhost.localdomain (sat 2017-07-15 09:31:03 cst): the system shutdown has been cancelled at sat 2017-07-15 09:32:03 cst! |
三 其他關機命令
1
2
3
|
halt init 0 poweroff |
四 其他重啟命令
1
2
3
|
reboot init 6 |
五 系統運行級別
六 查看系統運行級別以及修改系統的默認級別
1
2
|
runlevel cat /etc/inittab |
七 登出
1
|
logout |
八 實戰
1
2
3
4
5
6
7
8
9
|
[root@localhost tmp] # [root@localhost tmp] # runlevel n 5 [root@localhost tmp] # init 3 policykit daemon disconnected from the bus. we are no longer a registered authentication agent. [root@localhost tmp] # runlevel 5 3 [root@localhost tmp] # logout |
如有疑問請留言或者到本站社區交流討論,以上就是linux 中關機重啟的命令詳解,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
原文鏈接:http://cakin24.iteye.com/blog/2391507