Linux中的关机和重启命令

一 shutdown命令
shutdown [选项] 时间
选项:
-c:取消前一次关机命令
-h:关机
-r:重启
 
二 shutdown实战
[[email protected] tmp]# date
Sat Jul 15 09:28:35 CST 2017
[[email protected] tmp]# shutdown -r 05:30
Shutdown scheduled for Sun 2017-07-16 05:30:00 CST, use 'shutdown -c' to cancel.
[[email protected] tmp]# shutdown -r 05:30 &
[1] 4936
[[email protected] tmp]# Shutdown scheduled for Sun 2017-07-16 05:30:00 CST, use 'shutdown -c' to cancel.
 
Broadcast message from [email protected]n (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
[[email protected] tmp]# shutdown -c
 
Broadcast message from [email protected] (Sat 2017-07-15 09:31:03 CST):
 
The system shutdown has been cancelled at Sat 2017-07-15 09:32:03 CST!
 
三 其他关机命令
halt
init 0
poweroff
 
四 其他重启命令
reboot
init 6
 
五 系统运行级别

Linux中的关机和重启命令
 
 
六 查看系统运行级别以及修改系统的默认级别
runlevel
cat /etc/inittab
 
七 登出
logout
 
八 实战
[[email protected] tmp]# runlevel
N 5
[[email protected] tmp]# init 3
PolicyKit daemon disconnected from the bus.
We are no longer a registered authentication agent.
[[email protected] tmp]# runlevel
5 3
[[email protected] tmp]# logout