37

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?

marked as duplicate by jasonwryan, G-Man, Anthon, cuonglm, Networker May 25 '15 at 11:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from raspberrypi.stackexchange.com May 25 '15 at 8:55

This question came from our site for users and developers of hardware and software for Raspberry Pi.

  • 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
53

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 the shutdown scripts.

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

5

On my Fedora system, though they do different things, all these commands are handled by systemctl.

$ for cmd in halt poweroff shutdown; do file `which $cmd`; done
/usr/sbin/halt: symbolic link to `../bin/systemctl'
/usr/sbin/poweroff: symbolic link to `../bin/systemctl'
/usr/sbin/shutdown: symbolic link to `../bin/systemctl'

Their differences can be read on their man pages and also on systemctl man page.

You can also read a terrific answer detailing systemd & halt/poweroff/shutdown.

  • 7
    ... but that does not mean they do the same thing! – Ned64 May 25 '15 at 9:20
  • @Ned64 You are correct. systemctl does a lot of very different things. – rickhg12hs May 25 '15 at 9:49
  • 1
    @rickhg12hs: busybox and dropbear also use that concept, but the name of the symbolic link determines the behavior. – 0xC0000022L May 25 '15 at 11:05
  • 2
    @0xC0000022L That's what the man pages detail and is described very well in the linked answer. – rickhg12hs May 25 '15 at 11:07

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