Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this correct command to shutdown Leopard after 60min?

sudo shutdown -h 60

share|improve this question
up vote 4 down vote accepted

The correct usage from the command line for shutting down Mac OS after 60 minutes is:

sudo shutdown -h +60

That is not the method that Apple recommends using, though it is probably the best way on a headless server. (Update: See comment and link from @radius - the use of shutdown is recommended by Apple's server CLI admin guide). From the Command Line Junkies Guide to Mac OS X (the site is out of date but the reference to using osascript is current):

Rebooting and Shutting Down

Although you can reboot or shut down Mac OS X systems via the traditional halt, reboot and shutdown commands, the Apple-recommended way of turning off the computer remotely is to send the Finder an Apple Event. This can be accomplished using the osascript command to run an AppleScript:

osascript -e 'tell application "Finder" to shut down'


osascript -e 'tell application "Finder" to restart'

Of course, this will only work if there's a user logged in, which will typically not be the case with, say, headless servers, in which case you should be able to use traditional UNIX commands without negative consequences.

share|improve this answer
Apple server CLI admin guide (…) recommand shutdown/restart commands, so it's totaly OK – radius Aug 16 '10 at 15:11
+1 Thanks @radius - updated my post. – runlevelsix Aug 16 '10 at 15:27
The problem with the shutdown approach is that it kills all running GUI apps, without the option to save the data like with the osascript approach. On a server, this should be OK, but on a workstation, it might be a problem. Still, I use shutdown most of the time, because it is way faster if you have many applications open. – Sven Aug 16 '10 at 15:32

Your Answer


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.