This brief tutorial shows students and new users how to reboot | restart Ubuntu from the command line using the systemctl or shutdown commands.
For student or new user looking for a Linux system to start learning on, the easiest place to start is Ubuntu Linux OS…. It’s a great Linux operating system for beginners.
Ubuntu is an open source Linux operating systems that runs on desktops, laptops, server and other devices…
When learning how to use Ubuntu, you will find that Linux isn’t so different than Windows and other operating systems in so many ways, especially when it comes to using the system to get work done.…
Both Ubuntu and Windows systems allow you to be productive, easy to use, reliable and enable you to install and run thousands of programs, from gaming to productivity suite software for individuals and businesses.
However, when you’re learning to use and understand Ubuntu Linux, you should also learn how to use the command line to terminal. Most Linux users should be able to do some basic command line tasks. This tutorial is going to show you how….
Below you’ll learn how to shutdown, restart or reboot Ubuntu from the command line. This should work both on Ubuntu desktops and servers OS.
When you ready continue with the steps below:
Option 1: Restart | Reboot using systemctl Command
Newer Linux systems, including Ubuntu are using systemctl command to manage different tasks. You can use it to change the system’s hostname, setup timezone and many more.
So, using the systemctl command you can reboot or restart Ubuntu by running the commands below:
sudo systemctl reboot
When you run the command above, the system will initial reboot immediately.
Logged-in users will be notified that the system is going to shutdown, and system’s services that are running will begin to stop processing.
If you don’t want users to be notified or send custom shutdown messages, the you can add command options.
To prevent user notifications, run the reboot command with the –no-wall option.
sudo systemctl --no-wall reboot
The command above will shutdown the system without notifying any logged in users.
If you want to send custom message that the system is going down for a particular reason, run the command with the –message=” “ option:
sudo systemctl --message="System Maintenance" reboot
The commands above will display a message to all logged in users that the system is going reboot with a message that reads:
This is how to reboot Ubuntu
Option 2: Reboot | Restart using the shutdown Command
You can accomplish the same goals as above using the shutdown command. The shutdown command is the oldest way to shutdown or reboot Linux systems, including Ubuntu.
To reboot Ubuntu using the shutdown command, run the command with the -r option:
sudo shutdown -r
The -r option tells the command to reboot.
By default the system will reboot after 1 minute. However, if can use other command options to specified how long to wait before going to reboot the system.
For example, to reboot the system after 5 mins, run the commands below:
sudo shutdown -r +5
That will reboot the system after 5 mins.
To specify an exact time to reboot, use the format hh:mm for hours and minutes.
Example, shutdown at 11:15am, run the command below
sudo shutdown -r 11:15
To immediately shutdown the system without waiting, run the commands with the now option:
sudo shutdown now
That will start the shutdown immediately!
If you scheduled a shutdown and want to cancel, run the command with option -c
sudo shutdown -c "Canceling scheduled reboot"
That’s it! This is how one can reboot using system from the command line.
Congratulations! you have learned how to reboot Ubuntu system from the command line using the systemctl and shutdown command.
You may also like the post below: