pmset
Properties
- tags
- Mac/CLI, CLI/Tool
pmset- Built-in macOS command for reading and changing power management settings: sleep timers, wake events, hibernation, and whether the system sleeps at all.
- Reading settings works as any user. Changing one needs root, so writes run under
sudo. Usage
disablesleepsudo pmset -a disablesleep 1stops the system from sleeping, including when the lid closes.sudo pmset -a disablesleep 0turns sleep back on, which is the macOS default.pmset -gshows the value asSleepDisabledunder "System-wide power settings".man pmsetdoes not document this setting.- MacOS/How To/Keep a Mac Awake with the Lid Closed uses it, through mise tasks that record the earlier value and restore it.
Related settings
mise tasks