Last Updated: February 25, 2016
·
4.06K
· kenergy

Power Management via Terminal

This command sets displaysleep to a 5 minute timer on battery power, leaving other settings on bat-
tery power and other power sources unperturbed.

pmset -b displaysleep 5

Sets displaysleep to 10, disksleep to 10, system sleep to 30, and turns on WakeOnMagicPacket for
ALL power sources (AC, Battery, and UPS) as appropriate

pmset -a displaysleep 10 disksleep 10 sleep 30 womp 1

Restores the system’s energy settings to their default values.

For a system with an attached and supported UPS, this instructs the system to perform an emergency
shutdown when UPS battery drains to below 40%.

pmset -u haltlevel 40

For a system with an attached and supported UPS, this instructs the system to perform an emergency
shutdown when UPS battery drains to below 25%, or when the UPS estimates it has less than 30 min-
utes remaining runtime. The system shuts down as soon as either of these conditions is met.

pmset -u haltlevel 25 haltremain 30

For a system with an attached and supported UPS, this instructs the system to perform an emergency
shutdown after 2 minutes of running on UPS battery power.

pmset -u haltafter 2

Schedules the system to automatically wake from sleep on July 4, 2009, at 8PM.

pmset schedule wake “07/04/09 20:00:00″

Schedules a repeating shutdown to occur each day, Tuesday through Saturday, at 11AM.

pmset repeat shutdown TWRFS 11:00:00

Schedules a repeating wake or power on event every tuesday at 12:00 noon, and a repeating sleep
event every night at 8:00 PM.

pmset repeat wakeorpoweron T 12:00:00 sleep MTWRFSU 20:00:00

Prints the power management settings in use by the system.

pmset -g

Prints a snapshot of battery/power source state at the moment.

pmset -g batt

If your system suddenly sleeps on battery power with 20-50% of capacity remaining, leave this com-
mand running in a Terminal window. When you see the problem and later power and wake the computer,
you’ll be able to detect sudden discontinuities (like a jump from 30% to 0%) indicative of an aging
battery.

pmset -g pslog