Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 01-04-2012
Member
 
Join Date: Nov 2011
Posts: 68
Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu
  

Hey guys I have come across a interesting piece of information for you all which I think would be very much useful for you all. So here is a glance for you all have a look at it. you can perform the following functions sleep / standby / hibernate / suspend with the help of command line only. I have tested the following commands in Ubuntu 8.04 using my Toshiba laptop. You can also give a try for the same and do let me know if that would be useful for you or not.

For the sleep mode you can enter the following code

Code:
pmi action suspend
for hibernate you can look out for the following code

Code:
pmi action hibernate
Now if you are interested in Gnome session first then you can use the following command before pmi.

Code:
gnome-screensaver-command –lock
With the help of these buttons you can create a button (launcher) on a Gnome panel . isn’t it a great idea. hope you all will like this method.

Reply With Quote
  #2  
Old 01-04-2012
Member
 
Join Date: May 2011
Posts: 397
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

You haven’t mentioned anything about the suspend and the resume state. Frankly speaking I am new to this pmi. I don’t know how is this pmi action implemented? Till now I was using ‘sudo /etc/acpi/sleep.sh’ and I faced several issues such as wireless was not getting connected when I resumed, the system does sometimes ignore the hdd parameters script. Anyways I will give a try for the commands that you have given, hopefully pmi will be able to give me a much better result than the sudo, that’s what I am expecting.
Reply With Quote
  #3  
Old 01-04-2012
Member
 
Join Date: Jul 2011
Posts: 319
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

See if you are using gnome then the proper solution should be

Code:
gnome-power-cmd suspend
or you can use

Code:
gnome-power-cmd hibernate
Reply With Quote
  #4  
Old 01-04-2012
Member
 
Join Date: Sep 2011
Posts: 105
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Quote:
Originally Posted by Python$ View Post
Hey guys I have come across a interesting piece of information for you all which I think would be very much useful for you all. So here is a glance for you all have a look at it. you can perform the following functions sleep / standby / hibernate / suspend with the help of command line only. I have tested the following commands in Ubuntu 8.04 using my Toshiba laptop. You can also give a try for the same and do let me know if that would be useful for you or not.

For the sleep mode you can enter the following code

Code:
pmi action suspend
for hibernate you can look out for the following code

Code:
pmi action hibernate
Now if you are interested in Gnome session first then you can use the following command before pmi.

Code:
gnome-screensaver-command –lock
With the help of these buttons you can create a button (launcher) on a Gnome panel . isn’t it a great idea. hope you all will like this method.
Quote:
Originally Posted by Jessalyn View Post
See if you are using gnome then the proper solution should be

Code:
gnome-power-cmd suspend
or you can use

Code:
gnome-power-cmd hibernate
Hey sorry to interrupt you all but I have tried with the following commands seems suspend operation is not working properly. Buttons on the GUI for suspend do work well but I will have to run some script in order to invoke some actions for the suspend. So I am just wondering what would be the script for the suspend button/? Well for once I tried running the same script as given above just replacing the words with suspend but it did not work for me, so what do you all have to say about this? Can you please reply to me on this.
Reply With Quote
  #5  
Old 01-04-2012
Member
 
Join Date: Nov 2011
Posts: 68
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Quote:
Originally Posted by silvery View Post
Hey sorry to interrupt you all but I have tried with the following commands seems suspend operation is not working properly. Buttons on the GUI for suspend do work well but I will have to run some script in order to invoke some actions for the suspend. So I am just wondering what would be the script for the suspend button/? Well for once I tried running the same script as given above just replacing the words with suspend but it did not work for me, so what do you all have to say about this? Can you please reply to me on this.
I just want to know how does the suspend button behave can you tell me some of the commands or the output that you get when you click on those buttons? That’s what I want to know.
Reply With Quote
  #6  
Old 01-04-2012
Member
 
Join Date: Sep 2011
Posts: 105
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Quote:
Originally Posted by Python$ View Post
I just want to know how does the suspend button behave can you tell me some of the commands or the output that you get when you click on those buttons? That’s what I want to know.
Well on typing pmi action suspend the message that I get is "The program 'pmi' is currently not installed. You can install it by typing:
sudo apt-get install powermanagement-interface".

So that’s the message that I get. Now recently I got to know that built-in Suspend in Keyboard Shortcuts does not work as well. what to do can you tell me?
Reply With Quote
  #7  
Old 01-04-2012
Member
 
Join Date: Nov 2011
Posts: 68
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Quote:
Originally Posted by silvery View Post
Well on typing pmi action suspend the message that I get is "The program 'pmi' is currently not installed. You can install it by typing:
sudo apt-get install powermanagement-interface".

So that’s the message that I get. Now recently I got to know that built-in Suspend in Keyboard Shortcuts does not work as well. what to do can you tell me?
Hey you can try out this one

Code:
sudo apt-get install pmi
after that you can use

Code:
sudo pmi action suspend
now as far as keyboard shortcut is concerned then you can bind the following command
Code:
‘gksu pmi action suspend’
to a keyboard shortcut, it might ask for the root password.
Reply With Quote
  #8  
Old 01-04-2012
Member
 
Join Date: Sep 2011
Posts: 105
Exclamation Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Quote:
Originally Posted by Python$ View Post
Hey you can try out this one

Code:
sudo apt-get install pmi
after that you can use

Code:
sudo pmi action suspend
now as far as keyboard shortcut is concerned then you can bind the following command
Code:
‘gksu pmi action suspend’
to a keyboard shortcut, it might ask for the root password.
I don’t understand how can suspend button ask for a password. Well suspend is a basic operation that is a part of the system, plus in some machines they are automatically set to suspend state. so I think it should not ask for any kind of password at all, what do you all say why should I set a password for such type of actions?
Reply With Quote
  #9  
Old 01-04-2012
Member
 
Join Date: May 2011
Posts: 392
Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

Hey dude just take a chill pill here is the following command for not entering the password.

Code:
sudo apt-get install powermanagement-interface
Now after that you can run

Code:
sudo visudo
now enter your username in that command line and add it

Code:
yourusername ALL=NOPASSWD: /usr/sbin/pmi
save it. now you will not be able to give any password for that particular command. I hope that’s helpful for you.
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu"
Thread Thread Starter Forum Replies Last Post
cannot communicate with primary dns server - Vista Suspend/Sleep/Standby issue DesTiny! Vista Help 1 29-04-2013 06:43 PM
Laptop won’t suspend or hibernate after installing Ubuntu 9.10 Scottish Operating Systems 2 30-05-2012 02:14 PM
Suspend, Hibernate unable to work in ubuntu 10.04 Bellare Operating Systems 9 31-03-2012 02:10 AM
Difference between Sleep or Standby and Hibernate sara Operating Systems 3 22-05-2009 11:47 PM
Improved Windows operations in Ubuntu (Linux) aneesh Operating Systems 1 24-12-2008 08:47 PM


All times are GMT +5.5. The time now is 07:46 PM.