Linux: Command to Shutdown / Restart / Sleep
Shutdown / Restart
You need to be root. So, add
sudo in front.
shutdown -P 0
shutdown -r 0
Sleep, Suspend, Hibernate
The most useful command is:
pm-suspend (aka sleep. Fast wake.)
The following commands may not be supported.
pm-hibernate(save most power. Slow wake.)
pm-suspend-hybrid(a combination of sleep and hibernate.)
pm-is-supported(test which is supported)
man pm-suspend to see its doc.
Note: some of these may not work.
What is the Difference Between Sleep and Hibernation?
Sleep mode (aka Suspend, Standby), puts your computer to a low power mode. The monitor is turned off, and RAM (memory) chip gets minimal power to sustain its data. Computer can quickly wake.
Hibernation mode saves more energy. It is similar to a complete power off. It saves RAM (memory) content to disk, and powers down spinning hard disk. However, hibernation takes longer time to wake up.
Ask me question on patreon