Linux and Unix halt, poweroff and reboot commands

Quick links

About halt, poweroff and reboot
Syntax
Examples
Related commands
Linux and Unix main page

About halt, poweroff and reboot

Stop, power down, or reboot the system.

Syntax

reboot [OPTION]... [REBOOTCOMMAND]
halt [OPTION]...
poweroff [OPTION]... 

Description

These programs allow a system administrator to reboot, halt or poweroff the system.

When called with --force or when in runlevel 0 or 6, this tool invokes the reboot system call itself (with REBOOTCOMMAND argument passed) and directly reboots the system. Otherwise this simply invokes the shutdown tool with the appropriate arguments without passing REBOOTCOMMAND argument.

Before invoking reboot, a shutdown time record is first written to /var/log/wtmp

Options

-f, --force Does not invoke shutdown and instead performs the actual action you would expect from the name.
-p, --poweroff Instructs the halt command to instead behave as poweroff.
-w, --wtmp-only Does not call shutdown or the reboot system call and instead only writes the shutdown record to /var/log/wtmp.
--verbose Outputs slightly more verbose messages when rebooting, which can be useful for debugging problems with shutdown.

Environment

RUNLEVEL reboot will read the current runlevel from this environment variable if set in preference to reading from /var/run/utmp.

Files

/var/run/utmp File where the current runlevel will be read from; this file will also be updated with the runlevel record being replaced by a shutdown time record.
/var/log/wtmp A new runlevel record for the shutdown time will be appended to this file.

Examples

halt

Set the computer to a mode that enables a user to safely power off the system.

poweroff

Power off the system.

reboot

Reboot the system.

Related commands

Shutdown