All of the following commands require root permissions. The most common way to do this is prefix the command with sudo
.
The command for Suspend (Sleep) is pm-suspend
(sudo pm-suspend
etc.)
The command for Hibernate is pm-hibernate
(Note that Hibernation mode is not compatible with all hardware, please test this before using it.)
The command for the hibrid of them both is pm-suspend-hybrid
The hybrid command saves the session to the Hard Disk (safer storage place), but the system will stay running, allowing for faster resume. This does not mean you can turn off your computer and have your session saved. You will need to use the regular hibernate command for that.
These commands are provided by the package pm-utils, installed by default in Ubuntu 12.04LTS
Source: http://manpages.ubuntu.com/manpages/precise/man8/pm-action.8.html
If you have problems with those commands, please see the source. It states that
On some hardware putting the video card in the suspend state and
recovering from it needs some special quirk handling. With the
--quirk-* options of the pm-suspend and pm-suspend-hybrid commands you
can select which quirks should be used.
A list of these quirks, and what they mean can be found here