Suspend, Hibernate, Shutdown, And Restart Your Linux System From The Command Line

Posted by Weston Ganger on August 01, 2015

Sometimes I find it handy to perform power actions from the command line or after running a script.

Its pretty simple

# to shutdown
sudo poweroff
# or 
sudo shutdown -h now 

# to restart
sudo reboot
# or
sudo shutdown -r now

sudo apt-get install pm-utils

# to suspend
sudo pm-suspend

# to hibernate
sudo pm-hibernate

# to suspend/hibernate hybrid
sudo pm-suspend-hybrid

There is also an alternative method to suspend but I find it less reliable

dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Related External Links:

Posted in Linux and Tagged with linux power-management 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts