The Limits of System Settings
If you want your MacBook to sleep after 10 minutes of inactivity, you can simply open the macOS System Settings and adjust the sliders in the “Displays” or “Energy Saver” pane.
However, the graphical interface hides dozens of advanced power management features. What if you want to schedule your Mac to automatically turn itself on at 8:00 AM every Monday? What if you want to know exactly what percentage of your battery capacity has degraded over the last three years? What if you want to force your Mac into “Safe Sleep” (hibernation) to preserve a dying battery?
To access these deep system controls, you must use the pmset (Power Management Settings) command in the Terminal.
1. Viewing Your Current Power State
Before you change anything, you can view a highly detailed readout of your Mac’s current power configuration.
pmset -g
This will output a list of active power settings. You will see values for things like displaysleep (when the screen turns off) and disksleep (when the hard drive spins down).
Crucially, pmset -g will also tell you why your Mac might be refusing to go to sleep. If a background process (like a large download or a rogue application) is preventing sleep, it will be listed next to the sleep variable.
2. Modifying Sleep Timers (The Terminal Way)
You can change the basic sleep timers directly via the terminal. Because these are system-wide hardware changes, you must use sudo.
To set the display to sleep after 15 minutes of inactivity:
sudo pmset displaysleep 15
macOS actually maintains separate power profiles depending on whether you are plugged into a wall outlet or running on battery. You can specify which profile to change using the -b (battery) or -c (charger) flags.
To set the Mac to sleep after 5 minutes when on battery (-b), but wait 30 minutes when plugged in (-c):
sudo pmset -b sleep 5
sudo pmset -c sleep 30
3. Scheduling Automatic Wake and Sleep
This is arguably the most powerful feature hidden from the modern macOS graphical interface. You can script the Mac to physically wake up or shut down on a recurring schedule.
To schedule the Mac to wake up (or power on) every weekday (Monday through Friday) at 7:30 AM:
sudo pmset repeat wake MTWRF 07:30:00
(Note the days of the week syntax: M=Monday, T=Tuesday, W=Wednesday, R=Thursday, F=Friday, S=Saturday, U=Sunday).
To view your currently active schedule, type:
pmset -g sched
To cancel all recurring schedules:
sudo pmset repeat cancel
4. Checking Deep Battery Health
While the macOS menu bar tells you your current battery percentage, it doesn’t tell you the structural health of the lithium-ion cells. pmset can query the raw hardware sensors.
pmset -g batt
To see a massive, detailed log of the battery’s manufacturing data, charge cycle count, and maximum remaining capacity, you can query the system profiler via the terminal:
system_profiler SPPowerDataType | grep -i "Condition\|Cycle Count\|Maximum Capacity"
5. Managing Hibernation Modes (Safe Sleep)
By default, when you close your MacBook lid, it goes into standard sleep (keeping RAM powered so it wakes up instantly). If the battery gets critically low, it enters “Safe Sleep” (hibernation mode), copying the RAM contents to the SSD and shutting off power entirely.
You can force macOS to change its default hibernation behavior using the hibernatemode flag.
sudo pmset hibernatemode 0: Traditional sleep (desktops default). Fastest wake, but data is lost if power fails.sudo pmset hibernatemode 3: Safe Sleep (laptop default). Keeps RAM powered, but writes a backup to the SSD just in case.sudo pmset hibernatemode 25: True Hibernation. Writes RAM to the SSD and powers down immediately. Slowest wake time, but preserves battery life perfectly over long periods.
Conclusion
The pmset command exposes the underlying architecture of macOS power management. Whether you are automating a fleet of office iMacs to power down at midnight or configuring a MacBook for maximum battery preservation during a long flight, pmset provides absolute control over the hardware.