MacOS – Sudo Shutdown Now on Mavericks

macosshutdownterminal

I had read that you can "quietly shut down to single user mode" by running, within terminal:

sudo shutdown now

This sounds far preferable to having to restart the computer and hold CMND+S. However – at least in Mavericks it doesn't seem to work.

I'm getting:

shutdown: -h, -r, -s, or -k is required
usage: shutdown [-] [-h [-u] [-n] | -r [-n] | -s | -k] time [warning-message ...]

I thought that anything within square brackets was optional.

When I run it with the -k flag (which kicks all users off): sudo shutdown -k now, the output is:

Shutdown NOW!

*** FINAL System shutdown message from user@computer_name ***      
System going down IMMEDIATELY                                                  

System shutdown time has arrived
but you'll have to do it yourself                                         

Then if I try to open a new terminal:

NO LOGINS: System going down at 12:53
#my password
Login incorrect
login: 

Restarting again and terminal login is restored.

Can anyone offer some insight as to what's going on here?

Best Answer

First I would note the day of that hint - April 2001 - so a very old version of OS X

Next look at man shutdown

-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).

This means that all users are kicked off but also that noone can login, which is as you saw. This means the only user still logged in is root. However in recent OS X root is not enabled.