navigation

7 Ways to Restart Linux from Terminal

Rebooting Linux from the terminal may seem daunting, but don't worry, it's quite simple once you know the right commands. Rebooting Linux is necessary after updating, troubleshooting, or performing system maintenance. It ensures that changes take effect and keeps the system stable. This is especially true if you are managing a remote Linux system where you can only reboot Linux from the terminal.

Whether you need an immediate reboot, a scheduled reboot, or a forced shutdown, there is a method for every situation. In this article, we will discuss different ways to reboot Linux using the terminal.

 

1. Use the reboot command

The reboot command safely terminates any running processes. It ensures that ongoing tasks are properly closed before rebooting the system. This helps prevent data loss and maintains system stability. To reboot your Linux system immediately, run the reboot command:

sudo reboot

Provide the appropriate password and press Enter to reboot Linux:

To force an immediate reboot, run the reboot command with the -f option :

sudo reboot -f

This will reboot your system immediately, regardless of any scheduled shutdown commands or running processes.

2. Use the shutdown command

You can use the shutdown command to restart your system immediately or schedule it for a specific time. For example, running the shutdown command with the -r option will restart your Linux system immediately:

 

sudo shutdown -r now

With the shutdown command, we can schedule a reboot after a specific time by specifying a number of minutes. For example, to reboot a Linux system after 2 hours, run:

sudo shutdown -r +120

If you scheduled a reboot but changed your mind, you can easily cancel it with the -c option :

sudo shutdown -c

3. Use the systemctl command

In modern Linux distributions using systemd, the recommended way to reboot the system is to use the following command:

sudo systemctl reboot

This command will terminate all running processes and safely reboot the system.

4. Using the init command

In older Linux distributions using SysVinit, the system can be rebooted with the following command:

sudo init 6

When you run init 6, the system switches to run level 6, which means the system is ready to reboot. It stops all running processes, unmounts the file systems, and then reboots the system. While this command still works on some systems, you should use the systemctl reboot command for newer Linux versions using systemd.

 

5. Use the telinit command

The telinit 6 command reboots Linux by instructing init (or systemd on modern systems) to switch to runlevel 6, which triggers a reboot:

sudo telinit 6

This command ensures that the system reboots in a controlled manner by following the proper shutdown procedure.

6. Using REISUB (Magic SysRq Key)

If your Linux system becomes unresponsive, you can safely reboot it using the R, E, I, S, U, B (BUSIER backwards) key sequence, which prevents data corruption. This method sends specific commands to the kernel using the SysRq (System Request) key. To reboot your Linux system using this method, hold down the Alt + SysRq (Print Screen) keys on your keyboard and press each of the following keys in order:

  1. R : Puts the keyboard in raw mode, taking control away from applications.
  2. E : Send termination signal to all processes.
  3. I : Send shutdown signal to all processes.
  4. S : Force disk sync, ensuring all data is written to the drive.
  5. U : Remount all file systems in read-only mode, preventing corruption.
  6. B : Restart the system immediately.

This method is useful when the system is unresponsive but still accepts keyboard input.

7. Reboot Linux via SSH

If you are managing a Linux server remotely and need to reboot, first connect to the server using SSH :

ssh user@your-server-ip

 

Once connected, you can reboot the system immediately with:

sudo reboot

Similarly, if you need to schedule a reboot, you can use the command:

sudo shutdown -r +10 # Reboots after 10 minutes

You can cancel a scheduled restart at any time by:

sudo shutdown -c

Just make sure you have the necessary permissions to run these commands!

Rebooting Linux from the Terminal is simple once you know the right commands. Whether you need an immediate reboot, a scheduled reboot, or a way to deal with a frozen system, Linux offers a variety of options to suit different situations. While systemctl reboot is the standard for modern distributions, older systems still support init and telinit. For remote management, SSH makes rebooting a server easy. With these methods, you can effectively reboot your system right from the Terminal whenever you need to.

Update 25 May 2025