1、将数据从内存同步到硬盘
sync
注意:不管是重启系统还是关闭系统,首先要运行 sync 命令,把内存中的数据写到磁盘中!!!
2、关机
shutdown 关机指令,你可以man shutdown 来看一下帮助文档。例如你可以运行如下命令关机:
shutdown –h 10 ‘关机提示信息’ 计算机将在10分钟后关机,并且在关机前显示关机提示信息
shutdown -h 多长时间(以分钟为单位) 计算机将在多少分钟后关机
shutdown –h now 立马关机
shutdown –h 20:25 系统会在今天20:25关机
shutdown –h +10 十分钟后关机
reboot 就是重启,等同于 shutdown –r now
halt 关闭系统,等同于shutdown –h now 和 poweroff
3、取消关机
shutdown -c
4、重启
shutdown –r now 系统立马重启
shutdown -r09:35 在 09:35am