e Learning
How to Shutdown Ubuntu Server
ターミナルからUbuntu
Serverをシャットダウンするには、shutdownコマンドまたはpoweroffコマンドのどちらかを使用できます。
shutdownコマンド
Ubuntuのshutdownコマンドは-P(Capital P)オプションを使用し、タイマー(いつ電源を切るか)を必要とします。
shutdown -P timer
タイマーとしてnowを渡すことで、Ubuntuサーバーの電源を即座に切ることができます。
例
shutdown -P now
これはUbuntuサーバーを直ちにシャットダウンします。
shutdown +3min
Ubuntu Server Will be poweroff in three minutes.

shutdown 12:20
サーバーは12時20分にパワーオフされます。

キーボードのCTRL + Cを押すと、保留中のシャットダウンをキャンセルすることができます
例

上記のスクリーンショットのようになります。 最初にUbuntu shutdownコマンドを発行し、5分後にUbuntuサーバーの電源を切りました。
Ubuntu Linuxのshutdownコマンドにはroot権限が必要なので、rootユーザーになるか、sudoでコマンドを実行できる管理者ユーザーになる必要があります。
Poweroffコマンド
Ubuntu Linuxのpoweroffコマンドにはタイマーオプションがありません。
Telinitコマンド
UbuntuのTelinitコマンドはランレベルの変更に使用され、ランレベル0は停止状態なので、telinitコマンドを使用してランレベルを0に変更すると、サーバーの電源が切れます。
telinit 0
ライブシステムでは、パワーオフやtelinitコマンドの代わりに、時間差でシャットダウンコマンドを使うことをお勧めします。