Fandom

How To Wiki

Howto shutdown a Linux computer via command-line

1,795pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

This is various ways to shutdown your Linux computer. These methods will likely run on an Unix like Operating system

/sbin/shutdownEdit

This command is standard to any Unix like OS, including Linux. This command requires root access or sudo. See How to allow non-super users to shutdown computer in Linux

Its usage is:

Usage:    shutdown [-akrhPHfFnc] [-t sec] time [warning message]
                  -a:      use /etc/shutdown.allow
                  -k:      don't really shutdown, only warn.
                  -r:      reboot after shutdown.
                  -h:      halt after shutdown.
                  -P:      halt action is to turn off power.
                  -H:      halt action is to just halt.
                  -f:      do a 'fast' reboot (skip fsck).
                  -F:      Force fsck on reboot.
                  -n:      do not go through "init" but go down real fast.
                  -c:      cancel a running shutdown.
                  -t secs: delay between warning and kill signal.
                  ** the "time" argument is mandatory! (try "now") **

If you just want it to turn off your computer right away, execute:

  • /sbin/shutdown -hP now


DBUS & ConsoleKitEdit

The following requires DBUS and ConsoleKit to be installed and running, which is true on most systems.

  • dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
  • The following is an old method that uses HAL and will not work on most systems because HAL has been deprecated.
    • dbus-send --print-reply --system --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown


acpidEdit

please add


XFCE4Edit

  • xfce4-session-logout --halt
    this may not work if you don't have XFCE installed properly, I needed to configure XFCE with UDEV, DBUS, and ConsoleKit, and have them all running.


GnomeEdit

  • gdm-control --shutdown


KDEEdit

please add


OtherEdit

Please add


ReferencesEdit

Also on Fandom

Random Wiki