Table of Contents
To restart Linux from the terminal, save your work and run sudo reboot. To give people time to log out, use sudo shutdown -r +10 to schedule the reboot ten minutes ahead. Run these commands on the machine you intend to restart.
1. Restart immediately with reboot
sudo reboot
This requests a normal reboot so the system can stop services and unmount filesystems. Save open documents, finish active transfers, and tell anyone using the machine before you run it.

2. Schedule or cancel a restart with shutdown
The -r option selects a reboot. Use now for an immediate restart or +120 to wait two hours. Run only the command that matches your intended timing.
sudo shutdown -r now
sudo shutdown -r +120
To cancel a pending restart before it begins, run the following command:
sudo shutdown -c
3. Restart a systemd machine with systemctl
sudo systemctl reboot
This is the direct way to request a normal reboot on a systemd host. After signing in again, uptime -s shows when the system most recently started, and systemctl --failed lists units that failed.
4. Use init on a SysVinit system
On older systems that use SysVinit, runlevel 6 requests a reboot. Confirm which init system is installed before using this legacy syntax.
sudo init 6
5. Use telinit to request runlevel 6
On systems with the SysVinit-compatible telinit utility, this performs the same runlevel change as init 6. Use one command.
sudo telinit 6
6. Recover a frozen system with Magic SysRq
If the desktop is frozen, try opening a text console and requesting a normal reboot first. If that fails and the kernel still accepts keyboard input, Magic SysRq may work if the required functions are enabled. Hold Alt+SysRq (often Print Screen) and press R, E, I, S, U, and B in order.
R restores keyboard control, E and I terminate processes, S requests a disk sync, U requests a read-only remount, and B reboots immediately. Wait for the sync and remount to finish before pressing B when you can see their status. Unsaved work may still be lost. The Linux kernel’s Magic SysRq documentation explains which actions your configuration allows.
7. Restart a remote host over SSH
Connect to the host, check its name, and make sure someone can reach its recovery console if SSH fails to come back. Replace server.example.com and admin with your server and account.
ssh admin@server.example.com
hostname
Run sudo reboot for an immediate restart or schedule a maintenance window with the following example:
sudo shutdown -r +10 "Scheduled restart in 10 minutes"
If you need to call off the restart, run sudo shutdown -c before the timer expires.

SSH may disconnect as the system goes down. Reconnect after the server boots and check the services you expect to be running. If a network service appears down, use the Linux ss command to check whether its port is listening.
Reader Comments 0
Sign in with email or Google to join the discussion.