Linux reboot Command: Restart the System Safely

reboot requests a restart of a Linux system. On a server, it affects running tasks and connected users, so it should be executed only after checking the target host and maintenance time.

What is the reboot command?

The usual reboot in a systemd environment requests a restart after cleaning up services and finishing filesystem procedures. The current SSH session will be disconnected immediately after the restart. The forced option -f can skip the normal shutdown process, so avoid it unless it is for responding to special issues.

Basic syntax

sudo reboot [option]

Installed implementations and options may vary depending on the distribution. Check the current system’s description with man reboot.

Examples

Confirm the target server

First, confirm that the host you are connected to is the intended target for reboot.

hostnamectl status

Check logged-in users

Check if there are tasks being done by other users.

who

System Restart

This is a change command executed after completing preliminary checks and notifications.

sudo reboot

What should be checked after a reboot?

sudo reboot immediately starts the system shutdown procedure, so you should not expect a single line of normal output as a result. In a remote SSH session, the connection will be lost, and services and running tasks will be interrupted.

sudo reboot

Examples of phenomena that may be seen in a remote connection:

Connection to host closed by remote host.

After reconnection is possible, check the new boot time with uptime or who -b, and check necessary services with systemctl --failed. You cannot conclude that the reboot was successful based solely on the disconnection message. Make sure to check any unsaved work and remote recovery paths first, then execute at the planned time.

Main Options and Format

Options/Format Description
No arguments Requests a normal system restart.
-f This is a forced restart. The filesystem may not be properly cleaned up.
--no-wall Skips the guidance message sent to other users.
shutdown -r +minutes An alternative to schedule a restart with some delay.

Precautions when using

When executing commands on a remote server, the connection may be disconnected immediately. Check if updates are in progress or if database write operations are ongoing, and prepare recovery access methods. Forced restarts increase the risk of data loss. If scheduling or cancellation is necessary, use shutdown -r +10 and shutdown -c.

Frequently Asked Questions

Can I immediately undo a reboot once executed?

You should not assume that an immediate restart can be reliably canceled. If cancellation may be necessary, schedule it with shutdown to allow some time.

Official Documentation

You can check the exact behavior of the options and implementation differences in the official documentation related to reboot.

More in This Category
Linux realpath Command: Resolve Absolute and Canonical Paths

Linux realpath Command: Resolve Absolute and Canonical Paths

Learn how to use the Linux realpath command to resolve relative paths, symbolic links, and redundant path components, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux help Command: Read Help for Bash Built-in Commands

Linux help Command: Read Help for Bash Built-in Commands

Learn how to use the Linux help command to read usage information for Bash built-in commands, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux mv Command: Move and Rename Files and Directories

Linux mv Command: Move and Rename Files and Directories

Learn how to move and rename files or directories with Linux mv, avoid unwanted overwrites, clarify destination paths, and handle cross-filesystem moves.

Linux apropos Command: Search Commands by Description

Linux apropos Command: Search Commands by Description

Learn how to use the Linux apropos command to find relevant manual pages by searching description keywords, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux ls Command: List Files and Directories

Linux ls Command: List Files and Directories

Learn how to use the Linux ls command to list files and directories with permissions, sizes, timestamps, and sorting options, with essential options, practical examples, output interpretation, and common troubleshooting tips.

A History of Linux: From a 1991 Hobby Project to Global Infrastructure

A History of Linux: From a 1991 Hobby Project to Global Infrastructure

Trace the history of Linux from Unix and the GNU Project through the first Linux kernel, distributions, enterprise adoption, cloud computing, containers, and modern infrastructure.

Linux timedatectl Command: Check Time Zone and Time Synchronization

Linux timedatectl Command: Check Time Zone and Time Synchronization

Learn how to check Time Zone and Time Synchronization with the Linux timedatectl command, including practical examples, key options, and important precautions.

Linux whereis Command: Locate Binaries, Source, and Man Pages

Linux whereis Command: Locate Binaries, Source, and Man Pages

Learn how Linux whereis locates binaries, source files, and manual pages, limits each search type, lists effective paths, and differs from which and find.

Linux comm Command: Compare Two Sorted Files

Linux comm Command: Compare Two Sorted Files

Learn how to compare Two Sorted Files with the Linux comm command, including practical examples, key options, and important precautions.

Linux lscpu Command: Inspect CPU Architecture and Cores

Linux lscpu Command: Inspect CPU Architecture and Cores

Learn how to inspect CPU Architecture and Cores with the Linux lscpu command, including practical examples, key options, and important precautions.