Linux系統關機和重啟命令簡介

來源:互聯網
上載者:User

Linux有如下的關機和重啟命令:shutdown, reboot, halt, poweroff,那麼它們有什麼區別呢?

shutdown - 建議使用的命令

shutdown是最常用也是最安全的關機和重啟命令,它會在關機之前調用fsck檢查磁碟,其中-h和-r是最常用的參數:

-h:停止系統服務並關機

-r: 停止系統服務後重啟

下面看幾個例子:

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分鐘後重啟並並發送通知給其它線上使用者

reboot

reboot表示立即重啟,效果等同於shutdown -r now

poweroff
poweroff表示立即關機,效果等同於shutdown -h now,在多使用者模式下(Run Level 3)不建議使用。

halt
不理會目前系統狀況下,進行硬體關機,一般不建議使用

查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.