On Mac OS a laptop will suspend to RAM when you shut the lid, when its been asleep for a certain (configurable) amount of time it will hibernate. This is generally good, since you get the fast sleep/wake advantages of suspend and the power saving goodness of hibernate.
Is there any similar thing for Ubuntu?
[I'm currently using Kubuntu 18.04 and loving it, though even suspend doesn't seem to work properly on my XPS 9560, but I guess that's another question]
Best Answer
In Ubuntu 18.04 LTS and above
suspend-then-hibernate
works similarlyIn this mode laptop sleeps or suspends to RAM when the lid is closed or a button is pressed. After a certain time that has been pre-set, the laptop will wake up and write the data in RAM to disk, and enter hibernate mode.
The advantage is, the laptop suspends (sleeps) more quickly when close the lid. If you wake it up before the pre-set time it resumes quickly as well. If you don't wake the it up before the pre-set time it automatically saves battery in hibernate mode shut-down.
In Ubuntu 17.10 and below
hybrid-sleep
was the closestIn this mode the data in RAM is written to disk for hibernating before the laptop entered sleep (also known as suspend) mode. If the battery gets critically low while sleeping, the laptop goes into hibernation before turning off power, so the data in RAM is not lost.
In case the battery is drained out while the laptop was in hybrid sleep mode, plugging it into the power socket and powering it up will bring it back to the state when the lid was closed to put the laptop to sleep.
See What is hybrid suspend for some more explanations.
From the Ubuntu manpage on systemd power-saving mode:
See this answer if you want to enable either
suspend-then-hibernate
orhybrid-sleep
in your Ubuntu laptop.Hope this helps.