MainspringGuides › pmset power settings
macOS Guide

pmset on Mac: Control Power Settings From Terminal

Updated July 2026 · 3 min read

System Settings shows you a handful of power options. pmset shows you all of them — display sleep, system sleep, hibernation, wake behavior — and lets you set each one differently for battery and charger. It's also the fastest way to find out why your Mac refuses to sleep.

Read your current power settings

Start read-only. No sudo needed:

# settings currently in effect
pmset -g

# settings per power source (battery vs charger)
pmset -g custom

The rows that matter most: displaysleep (minutes until the screen turns off), sleep (minutes until the whole system sleeps), and hibernatemode (how sleep is stored — more below). A value of 0 means "never." pmset -g custom splits everything into Battery Power and AC Power sections, which is how macOS actually stores them. These commands behave the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

Change settings for battery, charger, or both

Writes need sudo. Pick the power source with a flag: -b battery, -c charger, -a both.

# screen off after 5 minutes on battery
sudo pmset -b displaysleep 5

# system sleep after 30 minutes on charger
sudo pmset -c sleep 30

# never sleep while on the charger
sudo pmset -c sleep 0

# undo everything: restore macOS defaults for your hardware
sudo pmset restoredefaults

Note what pmset -g custom showed before you start if you want to return to a specific configuration rather than factory defaults — restoredefaults resets every pmset setting, not just the one you changed. Changes take effect immediately; there's nothing to restart.

hibernatemode: know it before you touch it

hibernatemode controls what happens to memory during sleep. Three values are supported:

The defaults are sensible; change this only if you have a specific reason (for example, 25 before storing a MacBook for weeks). sudo pmset restoredefaults puts it back if you're unsure what it was.

Find out what's preventing sleep

When a Mac won't sleep on schedule, some process is holding a power assertion. List them:

# what's keeping the Mac awake right now
pmset -g assertions

Look for lines under PreventUserIdleSystemSleep or PreventUserIdleDisplaySleep with a count of 1 or more — each names the process responsible (a browser playing audio, a backup mid-run, caffeinate, sharing services). Quit the named process and normal sleep resumes. pmset -g log | grep -i wake digs into wake history when the problem is the opposite one: a Mac that wakes on its own.

pmset also handles scheduled sleep and wake — the feature that lost its System Settings panel a while back but never left the command line:

# wake or power on at 7:45 every weekday
sudo pmset repeat wakeorpoweron MTWRF 07:45:00

# check the schedule
pmset -g sched

# undo: remove the schedule
sudo pmset repeat cancel
Power tweaks, one click

Mainspring puts the power settings worth changing — alongside 90+ other hidden macOS tweaks — into labelled, reversible toggles, so you get the control of pmset without memorizing flags or sudo commands.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

Keep the Mac awake on demand instead

If what you really want is "don't sleep while this task finishes," don't change persistent settings at all — use the built-in caffeinate command, which holds a sleep assertion only while it runs and cleans up after itself.