Ubuntu: How to Reboot or Shutdown from the Command Line
If you’re using Ubuntu or perhaps another flavour of Linux, there come a time when you need to either reboot (restart) or shutdown a machine via a terminal (command line) or shell command.
Of course, it does come as no surprise that in order to carry out either of these two commands, you will need administrator privileges on the machine that you are currently using, in other words, sudo is once more you best friend.
To shut down / power off your Ubuntu PC, type in the command:
sudo shutdown -h now
Alternatively, to restart / reboot your machine, enter the command:
As always, more information on both of these commands can be found via the man system: