在 Ubuntu 系统中,常用的关机命令有以下几种方式:
sudo shutdown -h now
-h 表示 halt(停止系统),now 表示立即执行。sudo),系统会正常关闭所有服务后断电。sudo shutdown -h +10
+10 表示 10 分钟后关机,时间可自定义(单位:分钟)。shutdown -h now)sudo poweroff
或
sudo halt
poweroff 会直接关闭电源,halt 会停止系统但可能不自动断电(取决于硬件)。如果使用的是桌面版 Ubuntu,可以通过: - 点击右上角系统菜单 → 电源按钮 → 选择 关机。
shutdown -h now 或 poweroff 以正常关闭服务。Command not found,可能是缺少基础工具(极少数精简系统),可安装 util-linux 包:
bash
sudo apt install util-linux希望这些命令能帮到你!