How to Restart Linux System?

Restarting a Linux system is a fundamental administrative task that can be accomplished using several commands, each tailored for specific scenarios. Here’s a brief overview of the primary methods to restart a Linux system. The following are the different types of methods for restarting the Linux System:

1. Using reboot command to restart our Linux system

Syntax:

sudo reboot

We use `sudo` as a prefix when we use the `reboot` command because we want to execute the command with root privileges, and to ensure that we have the necessary permissions to perform a system reboot while maintaining system security and integrity.

Force Immediate reboot in Linux system:

sudo reboot -f

Here we have used `-f` option for an immediate reboot without any delay. It is used to reboot our system forcefully.

2. Using shutdown command restart our Linux System

a) Restarting Immediately

  • The following command helps in restarting the linux system immediately:
sudo shutdown –r now
  • Here we have used `-r` option to indicate that a restart is intended. And used `now` is an argument that will specify time of execution here it now means that to restart immediately.

Note that the usage of the reboot, halt, and poweroff is almost similar in syntax and effect. Run each of these commands with –help to see the details. 

b) Scheduled a Restart

Simple reboot command has limited usage. The shutdown command is being used instead of the reboot command to fulfill much more advanced reboot and shutdown requirements. One of those situations is a scheduled restart. Following is the syntax which is being used to reboot your system after time defines by the TIME.

$sudo shutdown –r [TIME] [MESSAGE]

Here TIME has various formats. The simplest one is “now”, already been listed in the previous section, and tells the system to restart immediately. Other valid formats we have are +m, where m is the number of minutes we need to wait until restart and HH:MM which specifies the TIME in a 24hr clock.

Below are the examples and their respective outputs. Optional MESSAGE argument can be used to intimate the users prior to reboot to prevent the possible loss of data. 

Command to reboot your system after 5 minutes

  • The following command helps in rebooting your system after 5 minutes:
sudo shutdown –r +5 

Reboot your system after 02:00 A.M

  • The following command helps in rebooting your system at 2:00AM:
sudo shutdown –r 02:00

c) Cancelling Restart

If you want your system to discard the previously scheduled restart or shutdown you can simply call another shutdown command with the –c option and broadcast with it a message for the users about the cancellation of the restart.

  • The following command will cancel the scheduled restart operation:
$sudo shutdown –c [MESSAGE]

Cancel your scheduled Reboot

The previously scheduled reboot can be canceled by the system administrator by simply issuing another shutdown command with the –c option and an optional message argument.

$sudo shutdown -c "our custom example of canceling a scheduled shutdown"

Reboot Linux System Command with Examples

Rebooting a Linux system is a fundamental administrative task necessary for applying updates, troubleshooting, or system maintenance. Various commands are available to reboot a Linux system, each with specific options and use cases. This guide explores essential reboot commands such as `reboot`, `shutdown`, and `init`, illustrating their usage with practical examples to ensure a smooth and controlled reboot process.

Table of Content

  • What is Reboot in Linux System?
  • What are the shutdown Commands on Linux?
  • How to Restart Linux System?
  • Rebooting a Linux System Responsibly
  • Best practices for Rebooting Linux System Commands

Similar Reads

What is Reboot in Linux System?

The reboot command is used to restart or reboot the system. In a Linux system administration, there comes a need to restart the server after the completion of some network and other major updates. It can be software or hardware that is being carried on the server. Rebooting is needed so that the changes that the user has made can affect the server....

What are the shutdown Commands on Linux?

When a GUI isn’t available, or you’re remotely connected to a server, relying on command-line shutdown commands becomes essential. Here are the primary commands for shutting down or rebooting your Linux system:...

How to Restart Linux System?

Restarting a Linux system is a fundamental administrative task that can be accomplished using several commands, each tailored for specific scenarios. Here’s a brief overview of the primary methods to restart a Linux system. The following are the different types of methods for restarting the Linux System:...

3. Restarting our server remotely in Linux

Simply login your server with any of the ssh client using server authentication information and simply issue any of the following commands:...

Rebooting a Linux System Responsibly

The following are the practices you ensure for rebooting linux systems safely and efficiently:...

Best practices for Rebooting Linux System Commands

Rebooting a Linux system is a critical task that should be approached with care to ensure system stability and data integrity. Here are four best practices to follow when rebooting a Linux system:...

Conclusion

The article provides comprehensive the guidance on rebooting Linux systems through various methods, including the reboot command, shutdown command, init command, systemctl command, telinit command, and remote rebooting via SSH. It covers syntax, options, and examples for each method, offering practical solutions for both immediate and scheduled reboots....

Reboot Linux System Command [ Restart Linux ] – FAQs

How can I schedule a recurring reboot in Linux?...