System rebooting is a common practice, especially on laptops and desktop computers, to improve the performance of the devices. The most common reasons one might opt for a reboot are to clean unnecessary files from the operating system or to install new software updates.
Other benefits can be gained from rebooting an operating system, such as speeding up the device’s boot time, fixing corrupted registry entries, and launching programs with lower resource usage.
In this article, we will be covering the possible methods to reboot a Linux Operating system (OS) mentioned below:
- Using the reboot Command
- Using the shutdown Command
- Using the shutdown Command to Restart Instantly
- Using the shutdown Command to Timely Restart
- Using init Command
- Using systemctl Command
Let’s apply these methods one by one and see how you can reboot your Linux system using them.
Method 1: Using the reboot Command
As the name suggests, you can use a reboot command that will instantly reboot the Linux (OS) by typing:
$ sudo reboot
Method 2: Using the shutdown Command
Primarily, the shutdown command has different functionality, and it is used to turn off the Linux (OS) completely, but you can use it to restart as well. Let’s practice a few examples that can be used in this regard:
Example 1: Using shutdown to Restart Instantly
The shutdown command, when used with the “-r” flag, will reboot the system. However, when the “now” option is utilized, it will restart the system instantly:
$ sudo shutdown -r now
Example 2: Using shutdown Command to Timely Reboot
There are times when essential processes are running, so you need to wait until they are finished. During such times, you can reboot your Linux (OS) at a fixed time and do something else while it reboots. For example, here is the syntax you can use if you are planning to reboot your Linux (OS) after 10 minutes:
$ sudo shutdown -r 10
As you can see that it provides you the exact time frame and tells you when it would reboot the system. If you want to provide the exact time on which you want to reboot your system, then you can do that as well by typing:
$ sudo shutdown -r 10:30
The above command will automatically reboot the Linux (OS) at 10:30 am. It works in the 24-hour time frame, so if you plan to restart at 10:30 pm, you’ll need to set the time to 22:30.
Furthermore, if you are planning to cancel your scheduled reboot, then you can do that by typing:
$ shutdown -c
Method 3: Using the init Command
Initialization, or init, is the first process that starts when the Linux operating system is booted and runs until the system is shutdown. Init command has 6 different modes, and you can utilize the last one to reboot your system as shown below:
$ init 6
Method 4: Using the systemctl Command
You can reboot the system using the systemctl command by following the below-mentioned syntax:
$ sudo systemctl reboot
That’s a wrap-up!
For smooth system operation, rebooting the computer is highly recommended to clean or fix corrupt programs. A Linux system can be restarted using various command line utilities, i.e., reboot command, shutdown command, systemctl command, and init command. This post has demonstrated various commands to restart a Linux system using various command line utilities.