What’s the difference between poweroff and halt?

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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x