linux大多用在服务器上,很少关机。
正确的关机流程为:sync>shutdown>reboot>halt
sync 将数据由内存同步到硬盘中
shutdown 关机指令
shutdown -h 10 计算机将在10分钟后关机,并且会显示在登陆用户的当前屏幕中。
shutdown -h now 立即关机
shutdown -h 20:25 将会在今天20:25关机
shutdown -h +10 十分钟后关机
shutdown -r now 立即重启
shutdown -r +10 十分钟后重启
reboot 重启 等于shutdown -r now
halt 关闭系统,等同于shutdown -h now 和poweroff
另外还有
关机
poweroff
init 0
重启
init 6
如果要取消关机计划的话,可以用以下方式去尝试
- 针对于centos7.x之前的版本:Ctrl+c
- 针对centos7.x之后的版本:shutdown -c