What is the difference between the shutdown, halt and reboot commands?

31,271

halt brings the system down to its lowest state, but leaves it powered on.

shutdown brings the system down to its lowest state, and will turn off power (soft power switch) if it can. Most computers now can do so.

reboot restarts the system. It brings the system down to its lowest state, then starts it up again.

Which to do depends on what you want to do. halt is usually to get to a state where you can perform low level maintenance. shutdown is to power the system off, and reboot is to reboot it.

Share:
31,271

Related videos on Youtube

loosecannon
Author by

loosecannon

Software Engineer on Google Compute Engine

Updated on September 17, 2022

Comments

  • loosecannon
    loosecannon over 1 year

    Should I be using one or the other for different things?

    • Admin
      Admin over 13 years
      man halt covers the differences
  • Wuffers
    Wuffers over 13 years
    Whenever I use the halt command on Mac OS X and Linux, it completely shuts my system down.
  • Thom G
    Thom G over 13 years
    This is slightly incorrect. shutdown can bring the system to any of these states, including single user mode (the default). Also, there is the poweroff command, turning power off (if possible).
  • loosecannon
    loosecannon over 13 years
    yeah halt also completely turns my computer off ( Ubuntu server 9.04) but I normally just type halt to poweroff and reboot to restart because its shorter than the shutdown command. Any harm in that?
  • Greenonline
    Greenonline almost 9 years
    @loosecanon - ask your question in a separate question. :-) There is actually an issue with what you suggest, and could cause data loss.
  • Manuel Jordan
    Manuel Jordan about 2 years
    @RichHomolka about "halt is usually to get to a state where you can perform low level maintenance" what do you mean with that?. Thanks
  • Rich Homolka
    Rich Homolka about 2 years
    @ManuelJordan it’s not really used anymore, it was used back in the days of big honkin’ Solaris boxes. It was used to get the machine where the OS wasn’t running, whether that meant power off or drop to the equivalent of bios or whatever.
  • Manuel Jordan
    Manuel Jordan about 2 years
    @RichHomolka thanks for the polite explanation.