一、shutdown
关闭所有服务过后才会关机
- -c:取消前一个关机命令
- -h:关机
- -r:重启
- -k:向所有用户发送关机提醒,不会关机
# 取消关机命令
shutdown -c
# 立即关机(now立即)
shutdown -h now
# 定时20:30关机
shutdown -h 20:30
# 定时10分钟后关机
shutdown -h +10
# 立即重启(now立即)
shutdown -r now
# 定时20:30重启
shutdown -r 20:30
# 定时10分钟后重启
shutdown -r +10
二、其他
- halt:直接进行硬件级关机
- poweroff:关机
- init 0:关机
- reboot:重启
- init 6:重启