How to Restart Linux with a command

How to Restart Linux with a Command

In this tutorial, we’re going to show you how to use the restart command on Linux and how to restart (reboot) your system via the command-line interface (CLI).

We previously learned how to shut down Linux using a command. Now we’ll learn how to restart it. These commands will work on most Linux distros, including Ubuntu, Linux Mint, Fedora, Debian, Arch Linux, etc.

You might intuitively think that the command would be “sudo restart” but, it’s not.

Linux system restart

To reboot Linux using the command line:

  • Then type “sudo reboot” to reboot the box.

Wait for some time and the Linux server will reboot itself.

Are you using systemd based Linux distro? Try

  • sudo systemctl reboot

How to force restart Linux with the reboot command

You can use the “-f” option with the reboot command to force restart your Linux system. By using the -f option, the system won’t sync and unmount filesystems.

  • sudo reboot -f

How to restart Linux with the shutdown command (with or without a delay)

Aside from shutting your system down, you can also reboot it with the “shutdown” command by using the -r option:

  • sudo shutdown -r now

This is useful if you want to restart your system after a given amount of time (instead of now), you can specify a delay. For example, if you want to reboot the system after 10 minutes, you can run:

  • sudo shutdown -r +10
And if you want to cancel an already scheduled reboot, you can run:
  • sudo shutdown -c
How do I reboot remote Linux server?

Simply login as the root user using ssh command:

  • shutdown -r now
A note about systemctl command when using systemd

Are you using systemd as init on your Linux distro? Most modern Linux distro such as Debian, Ubuntu, CentOS, RHEL, Fedora, Arch, and many others uses systemd. Hence, we can use the following command to reboot the system. The syntax is:

  • systemctl reboot

Leave a Comment