Appendix:
If your keyboard is "locked up", so you can't enter a command like "reboot" which would run from "su" anyway, use the keyboard: hold down Alt + PrintScreen/SysRq, buttons and type "REISUB". It doesn't have to be capital letters. It will restart your computer gently. http://blog.kember.net/articles/reisub-the-gentle-linux-restart/
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 broadcast 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 shutting it down and halting it, you will restart your computer once it's shutdown. :)
For shutdown:
For restart:
Appendix: If your keyboard is "locked up", so you can't enter a command like "reboot" which would run from "su" anyway, use the keyboard: hold down Alt + PrintScreen/SysRq, buttons and type "REISUB". It doesn't have to be capital letters. It will restart your computer gently. http://blog.kember.net/articles/reisub-the-gentle-linux-restart/
Open your terminal with CTRL+ALT+T and do these following commands
To shutdown the system:
To restart:
& one more command for restart:
Another way as one of the user mentioned.
For shutdown:
or:
For restart:
You can get more info on the
shutdown
command by using one of the following:shutdown --help
man shutdown
Hate passwords (
sudo
) and love one-liners?For Ubuntu 15.04 and later
This is due to Ubuntu's shift in using
systemd
instead ofUpstart
Since hibernate is normally disabled by default in Ubuntu systems, you can enable this by checking this answer.
For Ubuntu 14.10 or earlier
Shutdown:
Restart:
Other commands you may like:
Suspend:
Hibernate: (if enabled on your system)
On 16.04 no need of
sudo
To shutdown/poweroff:
To reboot:
Use
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 broadcast message in the message area (like goodbye, or I'm shutting the thing down :P).To restart the computer, type
Now, instead of shutting it down and halting it, you will restart your computer once it's shutdown. :)