跳到主要内容

Linux关机重启

前言

这个不是简单? 我直接在 VM 关闭虚拟机吧就行了?

大哥,你现在是远程连接呢?

...

命令

shutdown

shutdown -h now # 表示立即关机

shutdown -h # 表示一分钟后关机

shutdown -r now # 立即重启
Bash

halt

就是直接使用,效果等同于关机. (与 shutdown -h now 等价)

sync

把内存的数据同步到磁盘

reboot

就是重启系统

注意细节

  1. 不管是重启系统还是关闭系统,首先要运行sync命令,把内存中的数据写入到磁盘中。

  2. 目前的shutdownreboothalt命令在关机前都进行了sync

请作者喝奶茶:
Alipay IconQR Code
Alipay IconQR Code
本文遵循 CC CC 4.0 BY-SA 版权协议, 转载请标明出处
Loading Comments...