All of the following commands require root permissions. The most common way to do this is prefix the command with
The command for Suspend (Sleep) is
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
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
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