Linux provides sysfs interface to power management / sleep states. Available states are represented by strings that can be found in /sys/power/state file:
# cat /sys/power/state freeze mem disk
- freze – suspend-to-idle (aka “s2idle”)
- mem – suspend-to-RAM (aka “deep”)
- disk – suspend-to-disk (aka “disk”)
Sometimes suspend-to-RAM is referred to as suspend and suspend-to-disk as hibernate. Most common mode I use is mem which will put linux into suspend-to-RAM mode. Meaning machine state will be saved in RAM and will go into sleep, very low power mode – power supply fan is off, CPU fan is off, screen is off, peripherals in very low power mode – and machine can be resumed with single button press – either keyboard or power button (in laptops). Grub is not used when resuming. It’s worth noting that suspend-to-RAM means if you loose power while machine is in sleep mode then the session and possibly unsaved work is lost.
Put machine into sleep:
# echo mem > /sys/power/state
What exactly mem does? Its action is configured via /sys/power/mem_sleep file:
# cat /sys/power/mem_sleep s2idle [deep]
As you can see in this case (Ubuntu 18.04) default action is deep sleep meaning suspend-to-RAM.
Detailed description can be found in linux kernel power states documentation: