65

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
  • 3
    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, 2015 at 0:36

1 Answer 1

89

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

3
  • 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? Jun 22, 2021 at 12:17
  • I would use shutdown --poweroff for that.
    – Liam
    Sep 17, 2021 at 19:53
  • 2
    This is out of date. See this answer for a more up to date answer: unix.stackexchange.com/a/196471/206286
    – xordspar0
    Sep 20, 2021 at 14:28

Not the answer you're looking for? Browse other questions tagged .