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 stat Command: Display Detailed File Metadata

Linux stat Command: Display Detailed File Metadata

Learn how to use the Linux stat command to inspect file size, permissions, ownership, timestamps, inode, and filesystem metadata, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux scp Command: Copy Files over SSH

Linux scp Command: Copy Files over SSH

Learn how to copy Files over SSH with the Linux scp command, including practical examples, key options, and important precautions.

Linux ssh Command: Connect to a Remote Host Securely

Linux ssh Command: Connect to a Remote Host Securely

Learn how to connect to a Remote Host Securely with the Linux ssh command, including practical examples, key options, and important precautions.

Linux sync Command: Flush Buffered Writes to Storage

Linux sync Command: Flush Buffered Writes to Storage

Learn how to flush Buffered Writes to Storage with the Linux sync command, including practical examples, key options, and important precautions.

Linux cmp Command: Compare Files Byte by Byte

Linux cmp Command: Compare Files Byte by Byte

Learn how Linux cmp compares two files byte by byte, reports the first mismatch, runs silently in scripts, limits ranges, and differs from diff and checksums.

Linux rsync Command: Synchronize Files and Directories

Linux rsync Command: Synchronize Files and Directories

Learn how to synchronize Files and Directories with the Linux rsync command, including practical examples, key options, and important precautions.

Linux w Command: Show Logged-In Users and Their Processes

Linux w Command: Show Logged-In Users and Their Processes

Learn how to show Logged-In Users and Their Processes with the Linux w command, including practical examples, key options, and important precautions.

Linux ping Command: Test Host Reachability and Round-Trip Time

Linux ping Command: Test Host Reachability and Round-Trip Time

Learn how to test Host Reachability and Round-Trip Time with the Linux ping command, including practical examples, key options, and important precautions.

Linux find Command: Search Files by Name, Type, Size, and Time

Linux find Command: Search Files by Name, Type, Size, and Time

Learn how to search with Linux find by name, file type, size, and modification time, combine expressions, run commands safely, and verify targets before deletion.

Linux dnf Command: Manage RPM Distribution Packages

Linux dnf Command: Manage RPM Distribution Packages

Learn how to manage RPM Distribution Packages with the Linux dnf command, including practical examples, key options, and important precautions.