Shutdown
Shutting down the system from the commandline is like any other action: At the very least, if your hands are on the keyboard, it is a lot quicker to type poweroff than to find your way to the mouse, open a menu, select "Shut down", then click "OK".
See also booting the system and runlevels.
You need root privileges to run any of the following commands.
The shutdown Command
This command will shut the system down in a safe way. "Safe" in the sense that the risk of data loss and system corruption is much lower than if you simply Power cycle / pull the plug. Typical usage:
# "Shutdown now" (User must switch power off manually) shutdown -H now # "Shutdown and switch power off now" shutdown -P now # "Reboot the system now" shutdown -r now
Options
These are some of the available options - for a complete list, see the man page:
Usage: shutdown [OPTION] TIME # bring the system down to maintenance mode ( Runlevel 1) shutdown now # reboot the system NOW ( Runlevel 6) shutdown -r now # power off the system NOW ( Runlevel 0) shutdown -P now # reboot in 5 minutes shutdown -r +5 # power off at 20h shutdown -P 20:00 # cancel a scheduled shutdown shutdown -c
Logged in users will receive a warning message, which is mainly useful with delayed shutdowns. This gives people a chance to log out normally.
Aliases / Related Commands
Unless invoked with the --force option, the following simply invoke the shutdown command:
- halt
- Have the system shut down, and stay down ( Runlevel 0). Similar to shutdown -H now.
- poweroff
- Like halt, the system shuts down, and stays down ( Runlevel 0). Similar to shutdown -P now.
- reboot
- Unlike halt and poweroff, have the system shut down, then bring it back up ( Runlevel 6). Similar to shutdown -r now.