027_基础篇_系统管理(四)_关机重启 在Linux领域内大多用在服务器上,很少遇到关机的操作。 命令 sync 将数据由内存同步到硬盘 halt 停机,关闭系统,但不断电 poweroff 关机,断电 reboot 重启,等同于 shutdown -r now shutdown shutdown [选项] 时间 shutdown -H 相当于--halt,停机 shutdown -r -r等于reboot,重启 参考示例 将当前服务器立即关机: [root@linuxcool ~]# shutdown -h now 将当前服务器立即重启: [root@linuxcool ~]# shutdown -r now 设定当前的服务器指定时间自动关机,格式为”小时:分钟“: [root@linuxcool ~]# shutdown -h 21:00 Shutdown scheduled for Wed 2023-05-18 21:00:00 CST, use 'shutdown -c' to cancel. 设定当前的服务器5分钟后关机,同时发送警告信息给所有已登录的用户: [root@linuxcool ~]# shutdown +5 "System will shutdown after 5 minutes" Shutdown scheduled for Wed 2023-05-18 20:47:25 CST, use 'shutdown -c' to cancel. 取消当前服务器上已有的关机任务: [root@linuxcool ~]# shutdown -c