Linux Reboot (Restart) Command

When the kernel is updated, or when troubleshooting hardware issues or finishing application installations, a system reboot is sometimes required. If you are running a headless Linux server, you need to know how to restart the system from the command line.

On modern Linux distributions, the systemctl utility manages system power state. The standalone reboot and shutdown commands are aliases to systemctl and remain available for compatibility. On most servers, these commands require root access or a user with sudo privileges.

Reboot Using systemctl #

Use systemctl reboot for the direct systemd command:

Terminalsudo systemctl reboot

For a shorter equivalent command, use reboot:

Terminalsudo reboot

Both commands behave identically. The system notifies all logged-in users and processes that it is going down, prevents new logins, closes open files, stops running processes, and restarts.

To suppress the broadcast wall message sent to logged-in users, use --no-wall:

Terminalsudo systemctl --no-wall reboot

To include a custom reason in the system logs, use --message=:

Terminalsudo systemctl --message="Kernel update applied" reboot

The message appears in the system journal:

outputSystem is rebooting (Kernel update applied)

To view it after the system comes back up, use journalctl :

Terminaljournalctl -b -1 | grep -i reboot

If a graceful reboot is unresponsive — for example because a process is stuck — add --force to skip the clean shutdown sequence:

Terminalsudo systemctl reboot --force

Use this only when a normal reboot does not complete, as it does not give running processes time to shut down cleanly.

Schedule a Reboot with shutdown #

The shutdown command with the -r option performs a reboot. Without a time argument, the system reboots after one minute:

Terminalsudo shutdown -r

The time argument accepts two formats:

  • Absolute time: hh:mm — reboot at a specific clock time
  • Relative time: +m — reboot after m minutes from now

To reboot at 10:00:

Terminalsudo shutdown -r 10:00

To reboot in 5 minutes:

Terminalsudo shutdown -r +5

To reboot immediately:

Terminalsudo shutdown -r now

To broadcast a custom message to all logged-in users alongside the standard notification, add it after the time argument. The wall command is used internally for this:

Terminalsudo shutdown -r +10 "Rebooting for hardware upgrade"

Note that a time argument is required when adding a custom message.

Cancel a Scheduled Reboot #

To cancel a pending reboot, run shutdown with the -c option:

Terminalsudo shutdown -c

To include a reason in the cancellation message:

Terminalsudo shutdown -c "Reboot canceled — issue resolved"

Quick Reference #

CommandDescription
sudo rebootReboot immediately
sudo systemctl rebootReboot using systemd
sudo systemctl reboot --forceForce reboot if graceful shutdown hangs
sudo shutdown -r nowReboot immediately via shutdown
sudo shutdown -r +5Reboot in 5 minutes
sudo shutdown -r 10:00Reboot at 10:00
sudo shutdown -r +10 "message"Reboot in 10 minutes with a custom message
sudo shutdown -cCancel a scheduled reboot

Troubleshooting #

System does not reboot after running systemctl reboot A process may be refusing to terminate cleanly. Wait up to 90 seconds for systemd to force-kill stubborn services. If the system remains unresponsive, run sudo systemctl reboot --force to bypass the graceful shutdown sequence.

SSH session drops immediately on reboot This is expected behavior. The server terminates all active connections as part of the shutdown sequence. Reconnect via SSH once the system has come back online.

shutdown -r +5 "message" returns a syntax error When adding a custom wall message to shutdown, a time argument is required. You cannot use a message without specifying a time. Use shutdown -r +0 "message" to reboot immediately with a message.

FAQ #

What is the difference between reboot and shutdown -r now? Both reboot the system immediately. reboot (and systemctl reboot) is the more direct invocation. shutdown -r now goes through the shutdown utility, which is useful when you want to schedule a future reboot or attach a custom wall message. The end result is the same.

How do I cancel a scheduled reboot? Run sudo shutdown -c. This cancels any reboot or shutdown scheduled with the shutdown command. It does not affect a reboot already in progress.

Will open files or unsaved data be lost on reboot? A graceful reboot sends termination signals to all running processes, giving applications time to save data and close files. Unsaved data in applications that do not handle signals — or that are force-killed — may be lost. Always save your work before rebooting.

How do I check when the system was last rebooted? Run last reboot to see a history of reboots, or uptime -s to see the current boot time. You can also check the system journal with journalctl --list-boots.

Conclusion #

Use sudo reboot or sudo systemctl reboot for an immediate restart, and sudo shutdown -r when you need to schedule a reboot or notify users in advance. Add --force only when a normal reboot is unresponsive.

If you have any questions, feel free to leave a comment below.

Tags

linux commands

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

Subscribe

Unsubscribe anytime. We respect your inbox.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page

Tag » How Long Does Sudo Reboot Take