Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've been using shutdown -h now in the terminal to turn off my iMac (sooo much faster than waiting for every program I use to close out), and I wondered if there were any downsides to shutting down this way.

Edit:

For those who care, i've been shutting down manually for a month or two now, and it doesn't seem to have affected my system/workflow at all. Definetely something to approach on system by system basis, but it's pretty awesome being able to shut down in 2 seconds without having to do the "program X has cancelled shutdown" rodeo.

share|improve this question
    
Why are you shutting down your iMac at all? Sleep seems to be more energy efficient than shutting down and rebooting on a regular basis. –  Gerry Jan 23 '13 at 23:13
    
I wouldn't say that's true @Gerry. That depends greatly on the model of the mac and how long it's sleeping for. It's much more energy efficient to shut down your Mac for the weekend than sleep it! –  Josh Jan 23 '13 at 23:30
add comment

1 Answer 1

up vote 1 down vote accepted

Yes, there are a number of downsides!!!

The reason this is faster is it's not as clean. When you choose "Shut Down" from the Apple menu, the OS sends an Apple Event to every running application asking it to quit. (Specifically, the quit Apple Event) If you have unsaved work, these apps will respond to this event by prompting you to save.

When you use /sbin/shutdown no apple events are sent! Instead, POSIX signals (specifically the TERM signal) are sent to every app. This tells the process to quit now, is likely to result in lost data because apps may not prompt you to save.

Using the "Shutdown" menu might present a dialog alerting you that certain applications have "canceled" the shutdown. This is a safety feature in case they have unsaved data. This will not happen with /sbin/shutdown. Any apps which don't respond to a TERM signal will be sent a KILL signal, which will forcibly terminate the app.

If you use "Legacy Filevault" (The version of Filevault where only your home directory is encrypted), then using the "Shutdown" command will initiate the process which frees up unused disk space in your "sparse bundle", the files which store the encrypted data for your home directory. /sbin/shutdown will not trigger this process.

There can be other unforeseen consequences as well. The outgoing firewall Little Snitch used to lose the firewall configuration when using /sbin/shutdown... they may have corrected this in later versions, but I know it was an issue last time I checked.

In summary, /sbin/shutdown will shut down the sore of the OS: it will flush disk buffers, and request (the POSIX way) that processes terminate, so you're not likely to experience disk corruption or serious side effects from using it. But it will not perform higher-level functions (like sending Apple Events) and therefore it is not the preferred way to shut down an OS X system. (But it's still far better than just killing the power)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.