Skip to content

Instantly share code, notes, and snippets.

@aasmith
Created August 24, 2014 18:13
Show Gist options
  • Save aasmith/aaaaf718eec1815e2887 to your computer and use it in GitHub Desktop.
Save aasmith/aaaaf718eec1815e2887 to your computer and use it in GitHub Desktop.
Power down with a one-time forced hibernate in OS X
# Before using this script, see output of pmset -g and note the value
# of hibernatemode.
pmset -g
# Save to disk, per pmset(1):
#
# hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The
# system will store a copy of memory to persistent storage (the disk), and
# will remove power to memory. The system will restore from disk image.
sudo pmset -a hibernatemode 25
# Power down right now.
sudo pmset sleepnow
# Back to normal for desktops (use whatever pmset -g was set to earlier)
sudo pmset -a hibernatemode 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment