On Apple computers, pmset is a command line utility to manipulate power management settings under the Darwin and macOS operating systems. It can assign sleep settings, schedule sleep and wake times, and display power information.
History The pmset utility first appeared in Darwin 6.0.1 and Mac OS X 10.2 "Jaguar". It has been updated periodically since its introduction, and is still available as of Darwin 21.2.0 and macOS Monterey.
Behavior The utility sets or lists power management settings. Some of the functionality provided by the utility is available through the GUI interface of the Energy Saver preference pane. However, pmset allows for greater flexibility and access to several options not available in the GUI. The utility can set different power management settings depending on usage scenario. Different settings can be applied for when the machine is running off a charger, battery, UPS, or all three. The appropriate flags are as follows:
-c (charger), adjust settings used while connected to a charger -b (battery), adjust settings used when running off a battery -u (UPS), adjust settings used when running off a UPS -a (all, default) adjust settings for all scenarios Additional arguments be supplied when assigning any power management settings. Power management arguments are discussed in greater detail below. When invoking the command, only specified arguments modify power management options. Any arguments already set will be unmodified by pmset unless those arguments are specifically included. The utility can schedule wake, sleep, power on or power off events. Events can be recurring based on arbitrary weekday and time combinations, or scheduled for future dates and times. The syntax for scheduling an event is as follows:
pmset [repeat, schedule] [sleep, wake, poweron, shutdown, wakeorpoweron] [<MTWRFSU> <date/time>] Previously stored events will be overwritten upon running this command. To schedule multiple events they must be entered in one command string. For example, to set a shutdown event every day of the week at 23:59 and a wake or power on event every day of the week at 7:00 enter the following:
sudo pmset repeat shutdown MTWRFSU 23:59:00 wakeorpoweron MTWRFSU 7:00:00 The get flag displays information about the current power management configuration, or a log of recent activity. If no additional arguments are supplied the flag will only display current settings. Additional get arguments are discussed in greater detail below. The get flag is as follows:
-g get, list current power management settings To view the currently scheduled events type:
pmset -g sched The utility is also able to configure hibernation and safe sleep options, and change Energy Saver profiles.
Power management settings The pmset utility recognizes the following arguments. Arguments can be passed in serial form in any order. Any bad syntax or unrecognized argument will cause the entire command to fail, resulting in an error message and brief help screen. Power management settings can only be changed by a privileged user.
… excerpt ends here. Continue reading the full article.