Linux Commands Examples

A great documentation place for Linux commands


, poweroff reboot or stop the system

see also : poweroff - shutdown - telinit - runlevel



halt [OPTION]...

poweroff [OPTION]...

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


/sbin/halt -h -p


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(2) system call itself (with REBOOTCOMMAND argument passed) and directly reboots the system. Otherwise this simply invokes the shutdown(8) tool with the appropriate arguments without passing REBOOTCOMMAND argument.

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


-f, --force

Does not invoke shutdown(8) 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(8) or the reboot(2) system call and instead only writes the shutdown record to /var/log/wtmp


Outputs slightly more verbose messages when rebooting, useful for debugging problems with shutdown.


Copyright © 2009 Canonical Ltd.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



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



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.


A new runlevel record for the shutdown time will be appended to this file.

reporting bugs

Report bugs at <>

see also

shutdown telinit runlevel


Written by Scott James Remnant <scott[:at:]netsplit[:dot:]com>

How can this site be more helpful to YOU ?

give  feedback