关机
systemctl poweroff -i
shutdown -h now
shutdown -h 30 #30分钟后关机
重启系统
systemctl reboot -i
shutdown -r now
shutdown -h 30 #30分钟后重启
reboot
发出关机警告
shutdown -k 30 “system will reboot ” #警告30分钟后将会重启系统,不会做操作
取消操作
shutdown -c #取消之前下达的关机和重启指令
举例
[root@wjy ~]# shutdown -r 30
Shutdown scheduled for 五 2022-01-28 09:41:46 CST, use 'shutdown -c' to cancel.
[root@wjy ~]# shutdown -cBroadcast message from root@wjy (Fri 2022-01-28 09:11:52 CST):The system shutdown has been cancelled at Fri 2022-01-28 09:12:52 CST![root@wjy ~]# shutdown -h 30
Shutdown scheduled for 五 2022-01-28 09:42:00 CST, use 'shutdown -c' to cancel.
[root@wjy ~]# shutdown -cBroadcast message from root@wjy (Fri 2022-01-28 09:12:02 CST):The system shutdown has been cancelled at Fri 2022-01-28 09:13:02 CST![root@wjy ~]#