0

So, I opened up single-user mode to show my friend how easy it was for a Mac to be directly hijacked if someone was able to steal the physical lap top (as opposed to hijacking remotely using SSH), and I couldn't exactly remember which shutdown now option to use (fortunately, I was prompted by the command line), so I defaulted to -h. Should I be worried if I use -h instead of -r? Is there any difference between these commands?

shutdown -h now
shutdown -s now
shutdown -r now
shutdown -k now
1
  • 5
    What in shutdown's manual page do you find unclear?
    – mmmmmm
    Feb 5 '16 at 15:37
3

As stated in the shutdown manual page (man shutdownentered in a Terminal window):

 -h      The system is halted at the specified time.

 -k      Kick everybody off.  The -k option does not actually halt the
         system, but leaves the system multi-user with logins disabled
         (for all but super-user).

 -r      The system is rebooted at the specified time.

 -s      The system is put to sleep at the specified time.

So to shutdown the Mac the -h option is the proper one. -r restarts it and -s puts it to sleep. The -k option doesn't halt your system at all.

0
1

Not much happens in single user mode - so I just just use a simpler command:

halt

The shutdown command is for sequencing a lot of the scaffolding that is erected to have the system processes start in a certain order, then user processes. Even with launchd simplifying much on OS X, all of this is relevant to full blown OS X - notice to allow programs to save work, close files, check point logs so that the next start has less work to do.

None of that matters in single user mode as halt flushes the IO and takes down the power to the hardware.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .