reboot

systemLinux/Unix
The reboot command is one of the most frequently used commands in Linux/Unix-like operating systems. reboot Restart the system

Quick Reference

Command Name:

reboot

Category:

system

Platform:

Linux/Unix

Basic Usage:

reboot [options] [arguments]

Common Use Cases

    Syntax

    reboot [options]

    Options

    Option Description
    -f, --force Force immediate reboot without gracefully shutting down services
    -w, --wtmp-only Only write a wtmp reboot record, don't actually reboot
    -d, --no-fsck Skip filesystem check on next boot
    --no-wall Don't send a message to all users before rebooting
    -n, --no-sync Don't sync hard disks/storage before reboot
    -p, --poweroff Power off the system after reboot
    -h, --halt Halt the system after reboot
    --help Display help message and exit
    --version Output version information and exit

    Examples

    How to Use These Examples

    The examples below show common ways to use the reboot command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    # Basic Examples Basic
    sudo reboot
    Restart the system immediately.
    # Advanced Examples Advanced
    sudo reboot --force
    Force an immediate reboot without gracefully stopping services.
    sudo reboot --wtmp-only Record a reboot in the wtmp file without actually rebooting. sudo reboot --no-wall Reboot without sending a message to all logged-in users. sudo reboot -f Forcefully reboot the system (shorthand for --force). sudo reboot -d Skip the filesystem integrity check on next boot. sudo reboot -p Power off the system after reboot (equivalent to poweroff). sudo reboot -w Only write a wtmp reboot record (shorthand for --wtmp-only). sudo reboot -n Don't sync before reboot. sudo reboot now Reboot immediately (the argument "now" is optional).

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    The `reboot` command is a fundamental system administration tool used to restart a Linux/Unix system. It gracefully terminates all running processes, unmounts filesystems, and then restarts the system. In modern Linux distributions, the `reboot` command is typically implemented as a symbolic link to the `systemctl` command or as part of the `systemd` suite of tools, though it maintains backward compatibility with older systems for ease of use. Key aspects of the `reboot` command include: 1. Privilege Requirement: In most configurations, the `reboot` command requires superuser (root) privileges, typically accessed via `sudo`, to protect against unauthorized system restarts. 2. Graceful Shutdown: By default, `reboot` attempts to gracefully terminate all running processes before restarting. It sends termination signals to applications, allowing them to save data and exit cleanly. 3. System Services: The command properly stops system services in the correct order to avoid data corruption or service issues. 4. Filesystem Integrity: Before restarting, the system synchronizes all cached data to disk to ensure filesystem integrity. 5. Session Management: The command notifies all logged-in users of the impending reboot, allowing them to save their work. 6. Boot Management: Various options allow control over how the next boot proceeds, such as skipping filesystem checks. Common scenarios for using the `reboot` command include: - After system updates that require a restart - When applying kernel changes or installing new kernel modules - To clear memory leaks or resolve system performance issues - After hardware changes or driver installations - To implement scheduled maintenance windows - As part of troubleshooting system problems While the `reboot` command is generally safe when used properly, the forced reboot option (`-f` or `--force`) should be used with caution, as it bypasses the normal graceful shutdown process and may lead to data loss or filesystem corruption. This option is typically reserved for situations where the system is unresponsive and cannot be restarted normally. In enterprise environments, the `reboot` command is often used within scheduled maintenance windows or coordinated with users to minimize disruption. Many system administrators use it in conjunction with monitoring tools to ensure systems come back online properly after the restart. The command is available on virtually all Unix-like operating systems, including Linux, BSD, macOS, and others, though specific options and behaviors may vary between implementations.

    Related Commands

    These commands are frequently used alongside reboot or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the reboot command works in different scenarios.

    $ reboot
    View All Commands