How can I suspend or hibernate my laptop using command line, without installing additional software?
MySQL – Does Column Order in WHERE Clause Affect Query Performance?
command linehibernatepower-managementsuspend
Related Question
- Mysql – EXPLAIN output suggests that the index is not being used
- MySQL Indexing VarChar
- MySQL – How to Decide Which Execution Plan is Better
- Mysql – Optimizing slow query
- MySQL Optimization – How to Optimize a Simple Query on a Large Table
- MySQL Performance – Query Takes Forever After Adding WHERE Condition
- Mysql – WHERE…LIMIT much slower than WHERE…ORDER BY…LIMIT in MySQL 5.5
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.