Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dmmcintyre3

macrumors 68020
Original poster
Mar 4, 2007
2,131
3
when I type sudo shutdown I get this
usage: shutdown [-] [-h [-u] [-n] | -r [-n] | -s | -k] time [warning-message ...]

I want to just type sudo shutdown and my computer shuts down.
 
when I type sudo shutdown I get this
usage: shutdown [-] [-h [-u] [-n] | -r [-n] | -s | -k] time [warning-message ...]

I want to just type sudo shutdown and my computer shuts down.

shutdown -r now -> restarts
shutdown -h now -> powers down
man shutdown -> gives you the shutdown manual
man <any command> -> gives you the unix manual to almost any command

alternatives:
reboot -> same as 'shutdown -r' but won't use launchd. just send the kill signal to running processes
halt -> same as 'shutdown -h' but <see 'reboot'>
 
Obviously you are using the terminal so this may not be useful to you but I shutdown my mac using the bottom left CTRL button and the top right Eject keys, which brings up the shutdown then just tap enter to select shutdown. There is an additional key you can press at the same time as ctrl and eject that will immediately shutdown your mac without the warning but I cant remember what it is (probably Command).
 
Why shutdown instead of sleep?

Becuase this is to be done remotely if I forget to turn the computer off and I will be away for a long time. I usually leave my computer on 24/7 if I am home. Sleep is only used on battery.
 
You know there is very minimal difference in power use between sleep and off, right? And no difference between off and hibernate? You can sleep it through SSH using one of these two:

pmset sleepnow
shutdown -s now


Also, this one changes a setting so telling the machine to make it sleep actually makes it hibernate:

sudo pmset -a hibernatemode 1
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.