How to Use the nvram and pmset Commands in macOS Terminal to Manage Power States and Boot Args

macOS power management and boot configurations are managed at deep firmware and kernel layers. While the graphical System Settings menu exposes basic battery health toggles, power users, fleet administrators, and audio/video engineers frequently encounter unexpected sleep interruptions, kernel panics, or clamshell display issues. The built-in command-line utilities pmset (Power Management Settings) and nvram (Non-Volatile RAM) provide low-level control over sleep timers, wake-on-LAN schedules, standby modes, and kernel boot arguments.

Inspecting and Auditing Active Power Settings with pmset

The pmset utility interfaces directly with the macOS Power Management daemon (powerd). To inspect your Mac’s current power settings across battery and AC power profiles:

# View active power configuration
pmset -g

# Display sleep assertions (programs actively preventing sleep)
pmset -g assertions

The assertions subcommand is an invaluable diagnostic tool when a Mac refuses to enter sleep mode. It lists the exact process name and PID holding a power assertion (such as NoIdleSleepAssertion or PreventSystemSleep held by web browsers, audio DAWs, or backup scripts).

pmset Directive Hardware Function Recommended Values
sleep System sleep idle timer in minutes. 0 (Never sleep) or 10–30 min.
displaysleep Display power-off idle timer in minutes. 5 to 15 min.
standby Deep hibernation mode writing RAM image to disk. 1 (Enabled) or 0 (Disabled).
womp Wake on network access (Wake-on-LAN). 1 (Enabled) or 0 (Disabled).
autorestart Automatic restart following an AC power loss. 1 (Enabled for headless servers).

Configuring Power Profiles for Battery and Charger

The pmset tool accepts scoped profile flags: -c (charger/wall power), -b (battery power), -u (UPS power), or -a (all power states):

# Prevent sleep entirely when connected to AC power
sudo pmset -c sleep 0

# Enforce strict 10-minute system sleep when running on battery
sudo pmset -b sleep 10

# Disable Power Nap to save battery while sleeping
sudo pmset -b powernap 0

Scheduling Automated Startup, Wake, and Sleep Events

For office workstations or lab machines that should boot automatically each morning and power down at night:

# Schedule Mac to wake or power on at 07:30 AM every weekday (MTWRF)
sudo pmset repeat wake MTWRF 07:30:00

# Schedule automatic shutdown at 21:00 (9:00 PM) every evening
sudo pmset repeat shutdown MTWRFSU 21:00:00

# Cancel all scheduled repeat power events
sudo pmset repeat cancel

Modifying Firmware Parameters with nvram

The Non-Volatile RAM (NVRAM) chips on Intel and Apple Silicon Macs preserve hardware state parameters across system reboots and operating system updates.

# Print all stored NVRAM variables
nvram -p

# Disable the startup chime sound (value %00 mutes chime)
sudo nvram StartupMute=%01

# Re-enable the startup chime
sudo nvram StartupMute=%00

Configuring Kernel Boot Arguments for Debugging

Developers diagnosing driver faults or kernel panics can configure boot arguments in NVRAM (requires disabling System Integrity Protection on certain systems or running in Recovery Mode):

# Boot macOS into Verbose Mode (displays boot logs instead of Apple logo)
sudo nvram boot-args="-v"

# Clear all custom boot arguments back to defaults
sudo nvram -d boot-args

Leveraging pmset and nvram enables Mac administrators to optimize battery longevity, schedule automated office power states, and troubleshoot persistent wake locks with terminal precision.

Get the best tech tips delivered straight to your inbox.

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