Linux Reboot (Restart) Command
3 min read
When the kernel is updated, unless you’re using Livepatch or KernelCare, you need to reboot your Linux system. A system reboot may also be required in other circumstances, e.g., when troubleshooting hardware issues, installing applications, and so on. If you’re running a headless Linux server, you need to know how to restart the system from the command line.
On most modern Linux distributions, the
systemctl utility replaces most of the power management commands used in the older Linux distributions with sysvinit. The
shutdown commands are aliases to
systemctl and are available in the system for compatibility reasons.
In this article, we’ll explain how to use the
shutdown commands to reboot your Linux machine. The commands must be run as root or user with
To reboot your Linux system, simply type
sudo systemctl reboot
The system will be restarted immediately.
When the reboot is initiated, all logged-in users and processes are notified that the system is going down, and no further logins are allowed. Linux will close all open files, stop the running processes, and restart the system.
To prevent the reboot command from sending a message, run the command with the
sudo systemctl --no-wall reboot
If you want to set a custom message explaining the reason for the reboot, use the
sudo systemctl --message="Hardware upgrade" reboot
The message will be shown in the logs:
System is rebooting (Hardware upgrade)
When used with the
-r option, the
shutdown command performs a system reboot:
sudo shutdown -r
By default, the system will be rebooted after 1 minute, but you can specify the exact time when you want the system to be rebooted.
The time argument can have two different formats. It can be an absolute time in the format
hh:mm and relative time in the format
+m where m is the number of minutes from now.
The following example will schedule system reboot at 10 A.M:
sudo shutdown -r 10:00
The following example will schedule system reboot in 5 minutes from now:
sudo shutdown -r +5
To shut down your system immediately use
+0 or its alias
sudo shutdown -r now
To broadcast a custom message along with the standard shutdown notification, type your message after the time argument.
The command below will shut down the system in 10 minutes from now and notify the users that a hardware upgrade will be performed:
sudo shutdown -r +10 "Hardware upgrade"
It is important to mention that you must specify a time argument when using a custom wall message.
If you have scheduled reboot and you want to cancel it, run
shutdown command with the
sudo shutdown -c
You can also broadcast a message describing why the reboot was canceled:
sudo shutdown -c "Canceling the reboot"
To reboot a Linux system type,
reboot in your terminal. It will take several seconds for the operating system to restart.
Feel free to leave a comment if you have any questions.