4 Different commands to Shutdown or Restart Ubuntu Linux

Restarting your Ubuntu computer is not some Sisyphean task and is quite easy using its graphical user interface. But what if you are using the command line server of Ubuntu and want to shut it down or restart using the terminal? So, in this tutorial, we learn a few commands that we can use to power OFF, Reboot, or shut down Ubuntu Linux PC or servers including a command to halt it. Also, having multiple commands to do one thing will give you the flexibility to choose the one that suits you the most.

Ubuntu commands to restart or shutdown the server 

1. Ubuntu Reboot command

The simplest command on the Ubuntu Linux terminal we can run to restart it is “Reboot“.  This command can be used with or without sudo, however, if some Admin process is not allowing you to restart the computer then it is recommended to use sudo with the command.

sudo reboot

The system will prompt you to enter the current user password to initiate the reboot command.

2. Sudo Shutdown Command

Another command that we can use to restart our Ubuntu system is the “shutdown” command with the -r option. It will properly first shut down the computer and then restart the same because we have used the -r option with it.

The syntax to use is here:

sudo shutdown -r now

3. REISUB Sequence (Emergency Restart)

If your Ubuntu system is not responding properly then the REISUB sequence is quite handy to safely start it. In this method, we have to type REISUB in our command terminal in the same sequence it is written while holding ALT and Print screen keys.

So, on your computer open the command terminal and then press the left-side Alt key and then Print Screen or SysRq keys on your Keyboard. After that type REEISUB sequence letters this will immediately restart your computer.

Let’s also learn what the letter of the REISUB command means.

  • R: Switch the keyboard from raw mode to XLATE mode.
  • E: Send the SIGTERM signal to terminate all processes except init.
  • I: Send the SIGKILL signal to kill all processes except init.
  • S: Sync all mounted filesystems to reduce the risk of data loss.
  • U: Remount all filesystems in read-only mode.
  • B: Immediately reboot the system.

4. Sudo Power- Off commands

Although the above command examples are enough to restart Ubuntu Linux, however those who just want to shut down their PC can use “power0ff“. Note: it will not restart your computer only shut down.

It is not only easy to remember but also to use. Let’s see how?

sudo poweroff

That’s it, your system will turn itself off immediately after running the above command.

If the previous command is not what you want then there is another one – “HALT“. It also works the same as the previous one.

Let’s know how to use it: You just need to type halt along with sudo.

sudo halt

Well, the above command will immediately shut all processes which could sometimes cause data loss of currently running software. So, to shut down everything properly we will use -p option that refers to Power off. If we don’t use this option then the command stops the CPU process at once instead of stopping them gracefully.

sudo halt -p

To learn more about the shutdown commands of Ubuntu see our articles… 

Other Articles:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.