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

shutdown and halt


What are differences between shutdown and halt command on linux?
Frequent Advisor
Posts: 44
Registered: ‎03-10-2011
Message 2 of 3 (272 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
Posts: 959
Registered: ‎12-20-1999
Message 3 of 3 (272 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.