Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Linux reboot 指令詳解:重開機參數與實戰範例

編輯:Linux 系統常見問題解答

指令用途

reboot 用於重新啟動 Linux 系統,相當於 shutdown -r now。

語法

reboot [選項]

常用選項表

選項說明
-w僅寫入 /var/log/wtmp 紀錄,不真正重開機
-d重開機但不寫入 /var/log/wtmp
-i重開機前關閉網路介面
-f強制重開機,不呼叫 shutdown(緊急情況使用)

實戰範例

正常重開機

[root@rhel ~]# reboot
Broadcast message from root@rhel
(/dev/pts/1) at 1:21 ...
The system is going down for reboot NOW!

僅記錄不重開機(測試用)

reboot -w

強制重開機(系統卡住時)

reboot -f

相關指令比較

指令行為適用場景
reboot立即重開機一般維護
shutdown -r now立即重開機,發送警告訊息給所有登入用戶多用戶環境
shutdown -r +1010 分鐘後重開機排程維護
systemctl reboot透過 systemd 重開機systemd 系統
init 6SysVinit 相容指令舊版系統

小結

日常管理用 reboot 或 systemctl reboot 即可;需通知用戶用 shutdown -r;系統無回應時才用 reboot -f 強制重開。

Copyright © Windows教程網 All Rights Reserved