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 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts