Linux关机与重启

Linux关机指令为:shutdown;重启指令为:reboot

sync #将数据由内存同步到硬盘中
shutdown #关机指令,你可以man 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

最后总结一下,不管是重启系统还是关闭系统,首先要运行sync命令,把内存中的数据写到磁盘中。