有幾種方法可以從命令行重新啟動Debian系統。本指南概述了最常見和有效的方法。
Method 1: The reboot
Command
The simplest method is using the reboot
command.這需要根特權:
Sudo重新啟動
您將提示您的密碼。
Method 2: The systemctl
Command
The systemctl
command, a powerful systemd tool, also offers a reboot function:
sudo systemctl重新啟動
此命令還需要root訪問。
Method 3: The /sbin/reboot
Command
對於立即,不間斷的重新啟動,請使用此命令:
/sbin/重新啟動
此命令無延遲執行重新啟動。
Method 4: The shutdown
Command
The shutdown
command, primarily used for system shutdown, can initiate a reboot using the -r
flag.立即重新啟動:
sudo關閉-r現在
例如,安排重新啟動,例如五分鐘:
sudo關閉-R 5
Method 5: The init
Command
The init
command manages run levels.運行6級啟動重新啟動:
sudo init 6
緊急重新啟動:魔術sysrq鍵
Magic Sysrq鍵提供了一種重新啟動冷凍系統的最後度假方法。這是一個內核級操作,僅應在緊急情況下繞過正常的關閉過程。謹慎使用,因為數據丟失是可能的。該過程涉及兩個命令:
Echo 1>/proc/sys/kernel/sysrq Echo B> /proc /sysrq-trigger
結論
Debian提供了多個重新啟動的命令行選項。選擇最適合您需求和舒適度的方法。 Remember to use sudo
where necessary to execute commands with root privileges.
以上是重新開始Debian的藝術的詳細內容。更多資訊請關注PHP中文網其他相關文章!