From the terminal you can do everything, in this case I will show how to know if your computer supports entering sleep or hibernation mode, and if it can how to do it.
To know if your computer can suspend and / or hibernate, we must read what is in the / sys / power / state file
If "mem" appears in the results, it means that we can suspend the computer. If "disk" appears it means that we can hibernate.
Both to suspend and to hibernate we need administrative privileges, so we must either execute the commands as root or with sudo.
To suspend we will use pm-suspend
To hibernate we will use pm-hibernate
Sleep and Hibernate at the same time:
If your computer supports both, that is, suspend and hibernate, you can use a hybrid of both.
What does this allow?
This is a suspension like the first command I showed you, but in addition to suspending, a system image is saved, that is, suspend + hibernate.
Let me explain better, if they leave the laptop in suspension and they are left with 0% battery when starting the laptop, the system would start in white, while with this command in theory, it suspends the system but if we run out of power when starting the laptop we will not have lost anything, because the image that was saved when suspending will be used + hibernate
Well, I hope you found it interesting.