該如何重新啟動?如何關機?
該如何重新啟動?如何關機?
Ubuntu 關機、重新開機指令
shutdown [參數] [Time]
shutdown 參數
- shutdown -r 系統重新開機
- shutdown -h 讓系統停止運作關機
- shutdown -c 取消關機指令
- shutdown -k 模擬關機,只會對使用者提出警告
關機並關電源
- $shutdown –help //可以檢視shutdown命令如何使用,當然也可以使用man shutdown命令。
- $shutdown -h now //立即關機
- $shutdown -h 0 //立即關機
- $shutdown -h +3 //3分鐘後關機
- $shutdown -h 18:45 “Server is going down for maintenance" //18:45關機並提醒
重新開機
- $reboot //立即重新開機
- $shutdown -r 0 //立即重新開機
- $shutdown -r now //立即重新開機
- $shutdown -r +3 //3分鐘後重新開機
- $shutdown -r 20:23 //在20:23時重新開機
sync : 這個指令是將暫存區的資料寫回硬碟
所以,我們最好在關機、重新開機指令前,加上 "sync"
資料寫回硬碟,重新開機
- $sync;sync;reboot //資料寫回硬碟,重新開機
- $sync;sync;init 6 //資料寫回硬碟,重新開機
資料寫回硬碟,關機
- $sync;sync;init 0 //資料寫回硬碟,關機
關機、不關電源
- $halt
- $poweroff
$halt,$poweroff 這兩個都是關機的命令,直接執行即可,但這兩個命令不會完整關閉和保存系統的服務,不建議使用。
留言
張貼留言
Aron阿龍,謝謝您的留言互動!