Ubuntu

How to Restart Ubuntu From the Terminal

How_to_Restart_Ubuntu_from_the_Terminal

Ubuntu is one of the best Linux distros currently available. Although this Linux distro was designed for personal computers (PC), it can also be deployed on servers. Ubuntu, which is based on Debian’s design. Every Operating System provides the facility of restarting your system as a solution to various problems. Ubuntu provides both ways: Command Line and Graphical User Interface to restart your system but, in this article, we will deal with the Command-Line approach to restart the Ubuntu system.

Any faulty software is deleted from active memory when a machine is restarted. The system loads the new copies of the software into active memory when it restarts. In addition, some operating systems necessitate a restart to complete updates or configurations. The reboot procedure allows stalled programs to exit, critical fixes to be applied, temporary files to be removed, damaged file systems to be repaired, and many other system administration chores to be completed.

Restart Ubuntu from the Terminal

To restart Ubuntu from the terminal, the below-mentioned commands will be used.

  • Restart Ubuntu by using the shutdown command
  • Restart Ubuntu by using the reboot command
  • Restart Ubuntu by using the init command
  • Restart Ubuntu by using the systemd way

Below these ways are discussed in detail.

Method 1: Restart Ubuntu by Using the Shutdown Command

This command is used to turn a system off, on, or restart it. It specifies the execution time with a time argument. For instant operation, the time parameter is set to “now”. Run the below-mentioned command to reboot the system now using the shutdown command:

$ sudo shutdown -r now

Text Description automatically generated with medium confidence

Run the below-mentioned command to restart the system after 1 min using the shutdown command:

$ sudo shutdown -r 1

Graphical user interface, text Description automatically generated

In a 24-hour time format, the format is “hh:mm.” We may also use “+m” to force a reboot in “m” minutes.

Run the mentioned command to reboot the system at 12:45 pm.

$ sudo shutdown -r 12:45

Graphical user interface, text Description automatically generated

Run the below-mentioned command to cancel the restart of the system by using the shutdown command.

$ shutdown -c

Text Description automatically generated

Method 2: Restart Ubuntu by Using the Reboot Command

The reboot command is the quick and easy way to restart a machine from the terminal. Run the mentioned command below to restart your Ubuntu system.

$ reboot

Graphical user interface Description automatically generated

Method 3: Restart Ubuntu by Using the init Command

The “/sbin/init” is the very first running process when the kernel is loaded in Ubuntu. It denotes that the process has a PID of 1. In Linux systems without “systemd” the ‘init’ command kills all current processes and synchronizes the discs before altering init states or run levels. Run level 5 is the default state. The ‘init 6’ command brings the system to a pause and restarts it in the specified state in the ‘/etc/inittab’ file.

Run the mentioned below command to restart the Ubuntu system using the init command.

$ init 6

Graphical user interface, website Description automatically generated

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

$ sudo init 2

Graphical user interface Description automatically generated

Graphical user interface, text, application Description automatically generated

Text Description automatically generated

Method 4: Restart Ubuntu by Using systemd Way

The “init” process has been substituted with “systemd” therefore ‘/sbin/init’ has become a symbolic link to systemd.

You might not be able to locate ‘/etc/inittab’ on systems that use systemd instead of the init system. Run the command mentioned below to restart the system.

$ sudo systemctl reboot

Text Description automatically generated

Conclusion

Every operating system needs to reboot or restart after some time due to various reasons. Some of the reasons are that certain software needs a reboot after installation to become fully functional, due to some configurational change, or maybe because of a software glitch. This article explains some approaches to restart the Ubuntu system (Linux OS) like restarting Ubuntu using shutdown command, reboot command, init command, and systemd way. You can go for any of the approaches according to your requirement.

Similar Posts