How to Restart Ubuntu from the Terminal


The world’s top Linux distribution is Ubuntu. This Linux distribution may be installed on servers even though it was created for personal computers (PCs). Based on the Debian design is Ubuntu. Every Operating System offers the option of restarting your computer as a fix for a variety of issues. Ubuntu 22.04 offers both command-line and graphical user interface methods for restarting your system, but in this post, we’ll focus on the command-line method.

When a computer restarts, any harmful software is removed from the working set of memory. When the system restarts, fresh copies of the program are loaded into working memory. Additionally, certain operating systems need a restart to finish updating or configuring themselves. The reboot process enables the application of necessary repairs, the deletion of temporary files, the restoration of broken file systems, and many other system management tasks.

Using Shutdown Command

This command is used to restart, turn on, or switch off a system. It uses the time option to specify the execution time. The time argument has the value “now” for instant operation. To restart the system using the shutdown command, use the following command:

$ sudo shutdown -r now

Restart-Ubuntu-from-Terminal

To restart the system after one minute using the shutdown command, use the following command:

$ sudo shutdown -r 1

Restart-Ubuntu-from-Terminal

Similarly, you can shut down at a specific time as well as can be seen in the image below.

$ sudo shutdown -r 12:45

Restart-Ubuntu-from-Terminal

Run the command shown below to prevent the system from restarting after executing the shutdown command.

$ shutdown -c

Restart-Ubuntu-from-Terminal

Using Reboot Command

The quickest and easiest way to restart a computer via the terminal is to use the reboot command. To restart your Ubuntu system, use the given command below.

$ reboot

Restart-Ubuntu-from-Terminal

Using init Command

When the kernel is loaded in Ubuntu, the “/sbin/init” process is the first one to start up. It indicates that the PID for the process is 1. The “init” command in Linux systems without “systemd” terminates all running processes and synchronises the hard drives before changing the init states or run levels. The default status of the run is level 5. The “init 6” command pauses the system before restarting it in the configuration supplied in the “/etc/inittab” file.

$ init 6

Run the below-mentioned command to restart the Ubuntu system into a multiuser mode.

$ sudo init 2

Restart-Ubuntu-from-Terminal

Restart-Ubuntu-from-Terminal

Using Systemctl Command

Since “systemd” has taken the place of the “init” process, “/sbin/init” has been transformed into a symbolic link to systemd.

On systems that utilize systemd in place of the init system, you might be unable to find “/etc/inittab.” Restarting the system requires running the command shown below.

$ sudo systemctl reboot

Restart-Ubuntu-from-Terminal

Conclusion

Every operating system eventually must reboot or restart for a variety of reasons. Some of the causes include the necessity for a reboot after installation for software to work properly, configuration changes, or even software bugs. This article describes several ways to restart the Ubuntu system (a Linux operating system), including utilizing the shutdown, reboot, init, and systemd commands. You can choose whichever strategy best suits your needs.

Print Friendly, PDF & Email