Howto shutdown a Linux computer via command-line

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

=/sbin/shutdown= 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 & ConsoleKit= 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

=acpid= please add

=XFCE4=
 * 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.

=Gnome=
 * gdm-control --shutdown

=KDE= please add

=Other= Please add

=References=
 * DBUS & ConsoleKit: https://wiki.archlinux.org/index.php/Allow_Users_to_Shutdown
 * Getting xfce4-session-logout to work right in Gentoo