How to configure a MacBook to hibernate when the lid is closed?
I found this question how to make macbook pro hibernate when closing lid and the answer is not given in the comments, there are just links to no longer existing external resources. So I had to find the solution myself with the hints provided.
Unfortunately I'm not allowed to answer and paste the needed commands, instead I'm prompted to “ask a new question”, so here we go.
You can configure your MacBook to hibernate (deep sleep) when closing the lid by setting the hibernatemode.
The default for notebooks is 3.
Setting it to 25 will configure the desired behavior.
# Confirm you have the default for mobile computers, 3
pmset -g | grep hibernatemode
hibernatemode 3
# Set it to hibernate, 25
sudo pmset hibernatemode 25
# Confirm correct mode is set
pmset -g | grep hibernatemode
hibernatemode 25
MacBook Pro 16″