• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

Linux Reboot (Restart) Command

Written by Admin, Updated On December 25, 2019
shutdown, terminal
Linux Reboot (Restart) Command

Linux system reboot required in many circumstances, like troubleshooting hardware issues, installing applications, kernel update, etc. This guide explains how to reboot (restart) the Linux system using command line.

In the latest Linux distros includes the systemctl utility. The reboot and shutdown commands are aliases to systemctl and are available in the system for compatibility reasons. You can use systemctl and shutdown commands to reboot your Linux machine. Ensure that you must login a root user or having sudo privileges.

Using systemctl#

You can simply run reboot or systemctl reboot to reboot your Linux system.

sudo systemctl reboot

Once 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.

If you don’t want to send message, just run command with --no-wall option.

sudo systemctl --no-wall reboot

Sometime if system reboot is required due to hardware maintenance and you want to set custom message then you can use --message= option.

sudo systemctl --message="Hardware change" reboot

It will be shown in log as below:

System is rebooting (Hardware change)

Using shutdown#

You can use shutdown command along with -r option to reboot the system.

sudo shutdown -r

Linux system will be reboot after 1 minute. You also can set specific time for reboot the system. You can pass the time argument using two different formats. It can be an absolute time in the format hh:mm or relative time in the format +m where m is the number of minutes from now.

For example, if you want to reboot system at 11:A.M. then run below command:

sudo shutdown -r 10:00

If you want to reboot system after 15 minutes, type:

sudo shutdown -r +15

To display a custom message along with the standard shutdown notification, type your message after the time argument.

sudo shutdown -r +10 "Hardware upgrade"

The above command will shutdown the system after 10 minutes from now and it will notify the users that a hardware upgrade will be performed.

You also can cancel the scheduled reboot using below command:

sudo shutdown -c

To specify the custom message why the sheduled reboot has been canceled by typing:

sudo shutdown -c "Reboot cancel"

Conclusion#

You can reboot your Linux system by just typing reboot in your terminal. In few seconds it will restart.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How To Install Git on CentOS 8
Next Article   How to Install Java on Debian 10 (Buster)

Related Posts

  • How to Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install PHP 8.2 on Debian 11
    How to Install PHP 8.2 on Debian 11 Linux February 24, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook