If running Ubuntu on servers, then the only way for most developers to interact and manage it is with the terminal. And for shutting it down and also restarting can be done from the terminal. And these days most of the problems and glitches with our systems are usually fixed with a simple restart hence here is how to restart Ubuntu.
How to restart Ubuntu from the terminal?
There are two different ways to restart your Ubuntu server or computer from the terminal –
- Reboot command
- Shutdown command
1. Reboot Command
This is the simple reboot command which will instantly restart your server upon entering.
$ sudo reboot
or you could also just use reboot if you are already logged in as the root user.
$ reboot
2. Shutdown Command
The shutdown command is usually used to completely shut down your server or computer but there are certain flags that you can use to restart your system with it.
$ sudo shutdown -r now
This will restart your system immediately. But to reboot at a later time you can use this command –
$ sudo shutdown -r +5
This will reboot the system after 5 minutes.