Just how can I suspend/hibernate from command line?

Just how can I suspend or hibernate my laptop computer making use of command line, without mounting added software?

0
2019-05-05 11:39:40
Source Share
Answers: 2

You can make use of the documents /sys/power/state to do this. First figure out what states are sustained :

[email protected]:_> cat /sys/power/state
standby mem disk

[email protected]:~> echo -n mem > /sys/power/state  # suspend to ram
[email protected]:~> echo -n disk > /sys/power/state  # suspend to disk

or using dbus :

# Suspend dbus - send - - session - - dest = org.gnome.PowerManager \ - - type = method_call - - print - reply - - reply - timeout = 2000 \ / org/gnome/PowerManager org.gnome.PowerManager.Suspend #Hibernate dbus - send - - session - - dest = org.gnome.PowerManager \ - - type = method_call - - print - reply - - reply - timeout = 2000 \ / org/gnome/PowerManager org.gnome.PowerManager.Hibernate

According to this entry in launchpad the above user interface was gotten rid of. So it would certainly not function any longer in Ubuntu.

0
2019-05-08 08:34:47
Source

Traditionally ubuntu sustained a rather candid method of suspend and also hibernate. Neither would certainly incorporate well with various other applications and also occasionally not also work with some equipments. The new method does not call for origin and also alerts all applications paying attention for power occasions.

Systemd Method

Starting with Ubuntu 16.04, systemctl call has to be made use of (See Suspend command in Ubuntu 16.04)

systemctl suspend

and also

systemctl hibernate

New Method

See the solution below on this web page from Adam Paetznick regarding the use of dbus. Preferably you would certainly create a ~/bin/suspend shortcut/script that makes making use of this activity very easy.

For usage over ssh, you need to modify policykit rules as outlined by Peter V. Mørch

Old Method

According to the Ubuntu Forum you can make use of the adhering to commands :

pmi action suspend

and also

pmi action hibernate

This calls for that you install the powermanagement - user interface plan (not examined).

sudo apt-get install powermanagement-interface

I have actually additionally located the commands sudo pm-suspend and also sudo pm-hibernate to work with my netbook.

0
2019-05-08 06:46:30
Source