Linux – the shell command to let a Linux box go sleep


I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?

Best Answer

Using the handy pm-utils package, you can issue commands to suspend and hibernate without echo'ing values to the system. For example:

$ pm-suspend
$ pm-hibernate