How can I suspend or hibernate my laptop using command line, without installing additional software?
Ubuntu – How to suspend/hibernate from command line
command linehibernatepower-managementsuspend
command linehibernatepower-managementsuspend
How can I suspend or hibernate my laptop using command line, without installing additional software?
Best Answer
Traditionally ubuntu supported a fairly blunt method of suspend and hibernate. Neither would integrate well with other apps and sometimes not even work on some machines. This new method doesn't require root and notifies all applications listening for power events.
Systemd Method
Starting with Ubuntu 16.04,
systemctl
call must be used (See Suspend command in Ubuntu 16.04)and
New Method (obsolete)
Obsolete circa Ubuntu 16.04; use
systemctl
instead, as above.See the answer here on this page from Adam Paetznick regarding the use of dbus. Ideally you would create a
~/bin/suspend
shortcut/script that makes the use of this action easy.For use over ssh, you should modify policykit rules as outlined by Peter V. Mørch
Old Method
According to the Ubuntu Forum you can use the following commands:
and
This requires that you install the powermanagement-interface package (not tested).
sudo apt-get install powermanagement-interface
I have also found the commands
sudo pm-suspend
andsudo pm-hibernate
to work on my netbook.