Console commands to hibernate and standby / sleep Linux machines

It’s great that Linux nowadays supports all the power management features available on computers. But it’s odd that beside the buttons to trigger standby/hibernate – which are only available in a graphical interface – there are no simple console commands to put the computer to sleep or into hibernation.

Standby and hibernation are very useful on (personal) servers in case of long power failures (of course, while using an UPS). This way the server can put itself to sleep – while retaining all running stuff (especially running virtual machines, which take ages to boot and close) ready to be restored when the power returns.

So the two (not so simple) console commands are:



Standby/Suspend to memory (S3 or S1, depending on BIOS settings)


The best way to prepare you system for future usage of these commands is to create two script files, namely standby and hibernate (with the appropriate content) and chmod them 755.


They are also another 2 states (4 in sum) and they are:

Not usually all supported from older hardware, you can check the kernel notes here

To see which of them are supported you can use:

You will see output like that: