How can I suspend or hibernate my laptop using command line, without installing additional software?
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. The new method doesn't require root and notifies all applications listening for power events.
Starting with Ubuntu 16.04,
systemctl call must be used (See Suspend command in Ubuntu 16.04)
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
According to the Ubuntu Forum you can use the following commands:
pmi action suspend
pmi action hibernate
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 and
sudo pm-hibernate to work on my netbook.