🐡🐡🐡

## Shell tips

You often use your computer multiple time in a day, and you don't like waiting for it to boot? Modern systems support two modes of "sleep" to reduce their energy usage while providing us a faster way to get things done.

The first mode is called suspending, it puts your computer into a sleep mode in which only the memory is powered up to prevent its data to be lost, in this state you can quickly resume your computer to its previous state in a few seconds. The energy cost of suspending will depend on the amount of ram, but it's between 0.5 and 2 Watts. This is particularly useful when you leave your computer for a short time.

The second mode is called hibernating, it totally shut down the system, but before doing so all your memory is saved in the computer storage, in the swap area to be precise. This takes some time to write all the memory on disk, but then your computer isn't drawing any power, however it will take some time to resume it again as all the memory need to be read from the disk. It is particularly useful when you leave your computer for a long time, and you want to keep your workspace as it is.

On OpenBSD, desktop environments such as XFCE, MATE or Gnome offer you the choice between suspending and hibernating in the shutdown menu. On the command line, you can run the command `zzz` to suspend, and `ZZZ` to hibernate. These commands need the service apmd to be running in order to work.