Every Linux admin restarts a machine sooner or later. Kernel builds, memory upgrades, IP changes, and NIC swaps all need one before they take effect. The linux reboot command handles the basic case, while shutdown, systemctl, and init cover timed restarts and older setups. This guide walks through each method with working examples, plus how to schedule, cancel, and verify a restart from the terminal.

What the Linux Reboot Command Does

The reboot command tells the operating system to stop running processes, unmount filesystems, and restart the machine. Admins run it after software patches, hardware work, or network changes, since a restart is what loads the new state.

A rebuilt kernel is the classic example. The new image only loads on the next boot. The same applies after changing firewall configs such as nftables rules at boot level, reassigning IP addresses, or adding RAM.

Most servers run headless, so admins reach them through SSH rather than a desktop. That makes the terminal versions of these tools the ones worth learning first. If you manage packages or edit configs before a restart, save open files in nano so nothing gets lost mid-edit.

Linux Reboot Command Syntax and Options

The basic form is short:

reboot [OPTIONS...]

A few flags matter in daily work. --help prints usage and exits. --halt stops the machine without cutting power. -p or --poweroff switches the machine off. -f or --force skips the normal shutdown sequence, and passing it twice bypasses systemd entirely. -w writes a wtmp log entry without restarting anything.

On systemd distros, reboot, halt, poweroff, and shutdown are all symlinks to systemctl. Run ls -l $(which reboot) to confirm this on your machine.

How to Reboot Linux from the Terminal

Linux offers several routes to the same result. Pick based on how much control you need.

Using the reboot Command Directly

sudo reboot

The sudo prefix grants root rights, which restarts require on most distros. Root access also works through switching users with su before running the command.

For a forced restart when the system hangs, run sudo reboot -f. Treat this as a last resort. It skips process cleanup and can leave filesystems dirty.

Reboot with the shutdown Command

sudo shutdown -r now

The -r flag means restart and now fires it right away. Where plain reboot only does instant restarts, shutdown adds timing and user warnings, covered in the scheduling section below.

systemctl Reboot on systemd Distros

RHEL, Fedora, Arch, CentOS, Debian, and Ubuntu all run systemd, so this is the native path:

sudo systemctl reboot

Swap in poweroff to shut the machine down instead. Some machines also support systemctl reboot --firmware-setup, which boots straight into UEFI where you can adjust Secure Boot and other firmware settings.

init and telinit

The init tool predates systemd and works through runlevels. Runlevel 6 restarts the machine, runlevel 0 powers it off:

sudo init 6

sudo telinit 6

Both still work on modern distros for compatibility, though systemctl is the current standard.

Reboot a Remote Server over SSH

Log in and pass the command in one line:

ssh [email protected] /sbin/reboot

Your SSH session drops as soon as the restart begins. That is expected. Wait a minute or two, then reconnect. Note that WSL2 instances restart differently, since Windows manages the VM rather than the Linux tools inside it.

How to Schedule or Cancel a Linux Reboot

The shutdown command takes a time argument and an optional broadcast message:

sudo shutdown -r [TIME] [MESSAGE]

TIME accepts now, +m for a delay in minutes, or HH:MM in 24-hour format. Two examples:

sudo shutdown -r +5 "Rebooting in 5 minutes, save your work"

sudo shutdown -r 02:00 "Scheduled maintenance restart"

To cancel a pending restart, run sudo shutdown -c. Add a quoted message to tell logged-in users the restart is off. Ubuntu users can find distro-specific notes in this guide to the reboot command in Ubuntu.

How to Check Reboot History in Linux

The file /var/log/wtmp records every login, logout, and restart. Read the restart entries with:

last reboot

This shows each boot with its timestamp, which helps confirm a scheduled restart actually ran. uptime -s prints the current boot time if you only need the latest one.

Safe Practices Before You Reboot

Warn users first. A five-minute notice through shutdown -r +5 gives people time to save work on multi-user systems.

Stop services cleanly before the restart. sudo systemctl stop apache2 closes a web server without cutting off active writes. Back up anything critical, since a restart after a kernel change carries some risk of not coming back.

Pick quiet hours for planned restarts, and check last reboot afterward to confirm the box returned on schedule.

FAQs

Do I need sudo to run the Linux reboot command?

Yes, on most distros. Restarting affects every user and process, so it requires root privileges. Run sudo reboot, or log in as root first. Some desktop distros allow it for locally logged-in users.

What is the difference between reboot and shutdown -r?

Both restart the system through the same shutdown sequence. The difference is control: reboot fires instantly, while shutdown -r accepts a time argument and a broadcast message for logged-in users.

How do I cancel a scheduled reboot in Linux?

Run sudo shutdown -c. This clears any restart or shutdown queued with the shutdown command. It cannot stop a restart that has already started executing.

What does init 6 do in Linux?

init 6 switches the system to runlevel 6, which triggers a restart. It runs shutdown scripts first, then reboots. Runlevel 0 powers the machine off instead. systemctl reboot replaces it on modern distros.

How can I see when a Linux server last rebooted?

Run last reboot to list restart events from /var/log/wtmp with timestamps. For only the most recent boot time, run uptime -s or journalctl –list-boots on systemd machines.

Image

Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.