Re: shutdown and halt

Go to solution
Super Advisor

shutdown and halt


What are differences between shutdown and halt command on linux?
Reiner  Rottmann
Frequent Advisor

Re: shutdown and halt

On a typically system this makes no difference.
See man 8 halt:

"If halt or reboot is called when the system is not in runlevel 0 or 6, in other words when it's running normally, shutdown will be invoked instead (with
the -h or -r flag). For more info see the shutdown(8) manpage."

shutdown tries to halt the system gracefully. Meaning it gives all running applications time to settle and stop themselves.

init 0

halt executes a sync to write changes to disk and stops the system.

As lots of users were confused about the different commands (halt, shutdown, restart, etc), some logic was put into these so that shutdown gets called where appropriate.
dirk dierickx
Honored Contributor

Re: shutdown and halt

linux improving unix here once again, but if you work on other unix systems besides linux, i suggest you keep using the shutdown command.

the halt command on unix isn't that friendly and doesn't run shutdown first...