58

To turn off my system, I can use one of these three commands:

sudo halt

Or:

sudo poweroff

Or:

sudo shutdown -h now

What are the differences between these commands, or are they all just aliases of each other?

1
  • 2
    This question is marked as duplicate, but the "answers" just raise more questions - at least for those not intimate with the inner workings of Linux. On Raspbian which is still init based reboot and poweroff are links to halt. shutdown is different (the differences described in the answers). Ubuntu MATE for the Pi2 is systemd based and all 4 are links to /bin/systemctl – Milliways May 26 '15 at 0:36
78

halt terminates all processes and shuts down the cpu.

poweroff is exactly like halt, but it also turns off the unit itself (lights and everything on a PC). It sends an ACPI command to the board, then to the PSU, to cut the power.

shutdown is like poweroff, but it also runs shutdown scripts which should stop things gracefully. Examples include giving programs a chance to close files, delete their lock files and unmount drives properly.

Sources:

https://serverfault.com/questions/191537/shutdown-what-is-difference-between-power-off-and-halt

http://osdir.com/ml/os.solaris.managers.summaries/2001-10/msg00027.html

A comment by Peter White

1
  • But which one to use if you want to shutdown and poweroff a system remotely gracefully, giving programs a chance to close files, delete their lock files and unmount drives properly? – Peter White Jun 22 at 12:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.