在 Linux 中,如果你已经执行了重启命令但希望停止重启过程,可以尝试以下方法:
shutdown 或 reboot 命令shutdown -r +5 表示 5 分钟后重启)。shutdown -c 取消计划的重启。
bash
shutdown -c
shutdown 或 reboot 操作。systemctl rebootsystemctl reboot,通常系统会立即开始重启,可能没有足够时间取消。bash
systemctl cancel-job
systemctl reboot 通常是立即执行的。Ctrl + Alt + Del 组合键(如果未禁用)可能会中断重启,但成功率极低。bash
alias reboot="echo 'Use sudo reboot if you really want to reboot'"reboot 或 shutdown -r now) 通常无法停止,因为系统会立即执行。shutdown -r +10) 可以通过 shutdown -c 取消。如果系统已经开始关闭进程,建议保存工作并等待重启完成。