正确的关机流程为:sync→shutdown→reboot→halt。
sync命令可以将数据有内存同步到硬盘中。
shutdown为关机命令,我们可以使用命令"man shutdown"查看帮助文档。例如:
# shutdown -h 10 // 10分钟后关机,且显示在登录用户的当前屏幕上。
# shutdown -h now // 立即关机。
# shutdown -h 20:25 // 系统会在20:25关机
# shutdown -h +10 // 10分钟后关机
# shutdown -r now // 立即重启
# shutdown -r +10 // 十分钟后重启
# reboot // 重启
# halt // 关闭系统,等同于shutdown -h now 和 poweroff