How to Use the pmset Command on Mac to Manage Energy Saver and Battery Sleep Settings

While the macOS graphical interface in System Settings provides basic sliders for display sleep and energy management, power users, administrators, and developers frequently require granular control over hardware power states. The pmset (Power Management Settings) command-line utility provides direct access to the macOS power management subsystem. Using pmset in Terminal, you can independently configure battery and AC charger profiles, schedule automated startup and shutdown events, prevent idle sleep during intense rendering tasks, and diagnose system sleep assertion blocks.

Inspecting Active Power Management Profiles

Before adjusting power parameters, inspect the active configuration and power source by running:

pmset -g

This command outputs the current operational values for the active power source. To display the full breakdown of all configuration domains simultaneously, execute:

pmset -g custom

The terminal displays discrete parameter blocks for each supported hardware state:

  • Battery Power: Parameters enforced when running on internal DC battery.
  • AC Power: Parameters applied when connected to a MagSafe or USB-C power adapter.
  • UPS Power: Settings applied when connected to an external battery backup system.

Understanding Power Target Flags (-b, -c, -u, -a)

When applying modifications with pmset, you must specify which power source the rule applies to using target switches:

  • -b: Apply exclusively to Battery power.
  • -c: Apply exclusively to AC charger power.
  • -u: Apply exclusively to UPS power.
  • -a: Apply across All power sources simultaneously.

Configuring System, Display, and Disk Sleep Timers

Timers in pmset are defined in whole minutes. Setting a value to 0 completely disables the corresponding sleep action.

To configure display sleep to occur after 10 minutes on battery, but remain awake for 30 minutes when plugged into AC power:

sudo pmset -b displaysleep 10
sudo pmset -c displaysleep 30

To prevent the Mac from entering system idle sleep while connected to wall power (ideal for headless servers or remote SSH workstations):

sudo pmset -c sleep 0

Managing Standby Delay and Hibernation Modes

Modern Mac laptops utilise hybrid sleep states to balance immediate wake times with long-term battery preservation. Key settings include:

  • hibernatemode: Determines how memory state is saved when sleeping.
    • 0 (Standard Desktop Sleep): RAM remains powered; no disk image is written. Fastest wake, but data is lost if battery completely drains.
    • 3 (Safe Sleep / Laptop Default): RAM remains powered, and an image is mirrored to disk. If battery dies, state is restored from disk.
    • 25 (Deep Hibernate): System immediately writes RAM to disk and cuts all power to memory. Maximum battery conservation.
  • standbydelayhigh / standbydelaylow: Time (in seconds) the Mac waits before transitioning from regular sleep to deep standby.

To set standard laptop Safe Sleep across all profiles:

sudo pmset -a hibernatemode 3

Scheduling Automated System Wake, Sleep, and Power On

Administrators can schedule recurring hardware power events—such as waking a fleet of Macs at 06:00 for software patching and shutting them down at 21:00:

sudo pmset repeat wakeorpoweron MTWRF 06:00:00 shutdown MTWRF 21:00:00

Days are designated using single-character codes: M (Monday), T (Tuesday), W (Wednesday), R (Thursday), F (Friday), S (Saturday), and U (Sunday).

To cancel all active scheduled power events, run:

sudo pmset repeat cancel

Diagnosing Why Your Mac Refuses to Sleep

If your Mac display turns off but the system refuses to enter idle sleep, third-party applications or background daemons are likely holding active power assertions. To identify the exact processes preventing sleep:

pmset -g assertions

Inspect the PreventUserIdleSystemSleep and NoIdleSleepAssertion sections in the report. The output reveals the exact process name and PID responsible (e.g., an active browser download, a music streaming service, or an indexing daemon).

Essential pmset Settings Reference

Setting Key Standard Values Functional Behavior
sleep 0 to 180 (mins) Overall system idle sleep timer (0 disables).
displaysleep 0 to 180 (mins) Display timeout before screen powers down.
disksleep 0 to 60 (mins) Spins down internal or external rotational media.
womp 0 or 1 Wake on Magic Packet / Wake-on-LAN over network.
powernap 0 or 1 Allows periodic Time Machine backups and Mail sync during sleep.
tcpkeepalive 0 or 1 Maintains active TCP connections during sleep for Find My Mac.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.