On Mac OS X, is there a software way to get the machine to go to sleep / hibernate mode?

Is there any command line or AppleScript that I can write / run so that the machine sleeps automatically, or even better, into sleep mode?

I can run the program as root.

+3
source share
2 answers
osascript -e 'tell application "Finder" to sleep'
+8
source

To enter hibernation mode, you need to set the correct setting in the power manager.

Possible settings:

0 - Old-style sleep mode, with RAM turned on during sleep, safe sleep shutdown and super-fast wake up.

1 - , , , "" - .

3 - , 2005 . , . .

5 - , 1, , ( โ†’ ).

7 - , 3, , .

, , ( setuid script):

pmset -a hibernatemode 1; osascript -e 'tell application "Finder" to sleep'
+3

All Articles