Linux 关机、取消关机、重启

版权声明:最终解释权归属Hern、HernSong(hernsong)、苍鹭、www.hernsong.com所有! https://blog.csdn.net/qq_36761831/article/details/89429918

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 重启机器

shutdown –r +10 系统十分钟后重启

shutdown –r 10 系统十分钟后重启

reboot 系统立即重启,等同于 shutdown –r now

5、halt 命令通知硬件来停止所有的 CPU 功能,但是仍然保持通电。你可以用它使系统处于低层维护状态。注意在有些情况会它会完全关闭系统。

halt             停止机器
halt -p          关闭机器
halt --reboot    重启机器

猜你喜欢

转载自blog.csdn.net/qq_36761831/article/details/89429918