Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

How to shutdown the Ubuntu installed system and restart it by using terminal ?

share|improve this question

5 Answers 5

up vote 369 down vote accepted

For shutdown:

sudo poweroff

For restart:

sudo reboot
share|improve this answer

Open your terminal with CTRL+ALT+T and do these following commands

To shutdown the system:

sudo shutdown -h now 

To restart:

sudo reboot

& one more command for restart:

sudo shutdown -r now

Another way as one of the user mentioned.

For shutdown:

sudo halt


sudo init 0 

For restart:

sudo init 6

You can get more info on the shutdown command by using one of the following:

  • shutdown --help
  • man shutdown
share|improve this answer
You can also restart using sudo shutdown -r now. – Yamaneko Feb 8 '13 at 16:38
you can also shutdown with sudo halt or sudo init 0 and reboot with sudo init 6 – fromnaboo Apr 23 '13 at 15:17
@fromnaboo you can improve the answer my dear friend. we don't mind. please improve the answer as best as you can. – Raja Apr 23 '13 at 15:18
@jai the target is to offer the op and everyone else alternative ways of doing what he has asked. – fromnaboo Apr 23 '13 at 15:21
It seems shutdown -r now is preferable to reboot as the second can put you into maintenance mode – ubiquibacon May 11 '14 at 11:44

Hate passwords (sudo) and love one-liners?


/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop


/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

Other commands you may like:


/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Hibernate: (if enabled on your system)

/usr/bin/dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate
share|improve this answer
I always wondered how the GUI shutdown the system without needing sudo. I assume this is it. – triunenature Jul 28 at 14:23


sudo shutdown -h (TIME) (MESSAGE)

this will shutdown your computer and halt it. That is what the -h is for. Then, in the time area you can choose the shutdown delay ( in minutes ) and if you want you can send a brodcast message in the message area ( like goodbye, or I'm shutting the thing down :P ).

To restart the computer type

sudo shutdown -r (time) (message)

Now, instead of shuting it down and halting it, you will restart your computer once it's shutdown. :) Best of luck

share|improve this answer

As systemctl is been using these days,

  • to shutdown systemctl poweroff
  • to reboot systemctl reboot
  • to susupend systemctl suspend
  • to hibernate systemctl hibernate

Hope that helps.

share|improve this answer

protected by Raja Apr 2 '14 at 17:25

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.