基本介绍

  • shutdown -h now 立即关机
  • shutdown -h 1 1分钟后关机
  • shutdown -r now 立即重启
  • halt 关机 作用和上面一致
  • reboot 重启
  • sync 先把内存的数据同步到磁盘

注意细节:

  • 不管是重启还是关机,先要运行sync 把内存中的数据写回磁盘
  • 目前的shutdown/reboot/half 等命令均已在关机前进行了sync 不过小心为妙