[Linux] 關機和重啟命令詳解
阿新 • • 發佈:2019-01-25
Linux有如下的關機和重啟命令:shutdown, reboot, halt, poweroff,那麼它們有什麼區別呢?
shutdown - 建議使用的命令
shutdown是最常用也是最安全的關機和重啟命令,它會在關機之前呼叫fsck檢查磁碟,其中-h和-r是最常用的引數: [plain] view plaincopyprint?- -h:停止系統服務並關機
- -r: 停止系統服務後重啟
-h:停止系統服務並關機
-r: 停止系統服務後重啟
下面看幾個例子:
[plain]
view plaincopyprint?
- shutdown -h now --立即關機
- shutdown -h 10:53 --到10:53關機,如果該時間小於當前時間,則到隔天
- shutdown -h +10 --10分鐘後自動關機
- shutdown -r now --立即重啟
- shutdown -r +30 'The System Will Reboot in 30 Mins' --30分鐘後重啟並併發送通知給其它線上使用者
shutdown -h now --立即關機 shutdown -h 10:53 --到10:53關機,如果該時間小於當前時間,則到隔天 shutdown -h +10 --10分鐘後自動關機 shutdown -r now --立即重啟 shutdown -r +30 'The System Will Reboot in 30 Mins' --30分鐘後重啟並併發送通知給其它線上使用者