Mac hibernate/no sleep mode

If you are a windows user; you may find difficulties to do common task what we used to do in windows such as hibernate, lid open/close action etc. here are few example for mac commands:

Find what prevents your mac machine not to sleep; following command displays programs/process running background.

pmset -g assertions

If there is a 1 or more in the “PreventSystemSeep,” then there is an app preventing your Mac from sleeping.

Change Lid open / close action.

On MacBooks, when you close the lid, it automatically goes to sleep unless it is connected to an external display. We can change this behavior; open the Terminal and type the following command:

sudo pmset -a lidwake 0

Revert above action by entering the following command:

sudo pmset -a lidwake 1

Prevent Sleep while Idle.

To prevent your Mac from going to sleep while idle, then type the following command into the Terminal:

sudo pmset powerbutton 0

Following command to revert back to normal.

sudo pmset powerbutton 1

Finally easy one using GUI.


Following command to sleep mac machine instantly:
pmset sleepnow

The default MacBook Pro sleep setting maintains the current session on the RAM and thus requires a small power. There is a sudo command in the terminal that can alter this method by sending the session data to the hard drive and reducing the power drain in “deep sleep” mode.

sudo pmset -a hibernatemode 25

You can switch back to the regular sleep with the command:

sudo pmset -a hibernatemode 3

Run following command to determine your current sleep mode:
pmset -g | grep hibernate

sudo pmset -a hibernatemode 25

Recover some drive space

If you are switching back to normal from mode 25; run following command to free dis space.
cd /var/vm
sudo rm sleepimage

Hibernate mode values detail explanations:

hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of mem-ory memory ory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.

hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of mem-ory memory ory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want “hibernation” – slower sleeps, slower wakes, and better battery life, you should use this setting. Please note that hibernatefile may only point to a file located on the root volume.

Hibernate App. (paid version; you can ignore)


About Robiul

Robiul has 15 years of continuous successful career experience in ICT with extensive background in System Engineering, IT infrastructure design, operations and service delivery, managing IT projects / MIS functions for local and multi-national companies with in-depth knowledge of multiple operating systems as well as construct / manage small to medium size Data Center. Proven ability to design and implement medium to semi-large scale LAN/WAN/WLAN and system infrastructures. Academic qualification: Master of Science in Information Systems. Professional certifications are: MCSE, CCNA, ITIL and FoundStone Security Professional, VCP, NetAPP, CISSP etc.
This entry was posted in Apple and tagged . Bookmark the permalink.