shutdown and halt (257 Views)
Super Advisor
Posts: 1,704
Registered: ‎05-10-2003
Message 1 of 3 (257 Views)
Accepted Solution

shutdown and halt


What are differences between shutdown and halt command on linux?
Frequent Advisor
Reiner  Rottmann
Posts: 44
Registered: ‎03-10-2011
Message 2 of 3 (257 Views)

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.
Honored Contributor
dirk dierickx
Posts: 958
Registered: ‎12-20-1999
Message 3 of 3 (257 Views)

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...
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.