How to restart Ubuntu via terminal

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to reboot Ubuntu by using the terminal.

For example, rebooting is needed when you install a new desktop environment or kernel in Ubuntu, in order for changes to take effect.

Rebooting Ubuntu is very easy, and it can be done by using different commands when using the terminal, to do so, simply follow the steps below.

Reboot Ubuntu via Terminal

Terminal allows you to reboot your Ubuntu system by using the reboot command.

Reboot command is useful and needed in cases when you need to reboot your Ubuntu machine, without having to use GUI.

Before we start with the tutorial, first launch your Terminal by pressing CTRL + ALT +T

Reboot Ubuntu via reboot command

Rebooting command allow you to easily restart your Ubuntu machine by simply running the reboot command.

For example, to reboot Ubuntu, simply run the command below.

reboot

And your Ubuntu machine should reboot. If reboot command doesn't work, you may need to run it with sudo permissions.

sudo reboot

Reboot Ubuntu via systemctl

Another way of rebooting Ubuntu is by using the systemctl.

systemctl allows you to manage services in Ubuntu, which means you can use systemctl to perform various actions in Ubuntu, including reboot.

This is possible as Ubuntu uses systemd as system and service manager, so to reboot Ubuntu by using the systemctl command, simply run the command below.

sudo systemctl reboot

Reboot Ubuntu using /usr/sbin/reboot

Another way of rebooting Ubuntu is by running the reboot binary instead of the reboot command.

This happens when the reboot command is not added in your PATH, which means running reboot command won't work, and you will encounter the error "reboot: command not found"

To reboot Ubuntu in such cases, you can do so by running the reboot binary.

/usr/sbin/reboot

Reboot Ubuntu using the shutdown command

The shutdown command allows you to shut down your system, but it also allows you to reboot your system.

To reboot Ubuntu via the shutdown command, you can do so by using the -r option.

sudo shutdown -r 

The command above, will schedule a reboot that will be executed after one min.

If you want to reboot Ubuntu immediately, then you need to use the -r and now options.

sudo shutdown -r now

Conclusion

In this tutorial, you learned how to reboot Ubuntu via terminal by using four different commands, by using the reboot , systemctl , /usr/sbin/reboot and shutdown -r now command.

By now you should be able to reboot your Ubuntu machine, using any of the commands explained in this tutorial.