Pmset

Uses your system voice; voice and rate in settings.

Snapshot

≈ 8 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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.

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. autopoweroffdelay (AC power) delay before entering autopoweroff mode. (Value = integer, in seconds) standbydelaylow Delay before writing the hibernation image to disk and powering off memory for Standby. standbydelaylow is used when the remaining battery capacity is low. (Value = integer, in seconds) standbydelayhigh Delay before writing the hibernation image to disk and powering off memory for Standby. standbydelayhigh is used when the remaining battery capacity is high. (Value = integer, in seconds) networkoversleep This setting affects how macOS networking presents shared network services during system sleep. This setting is not used by all platforms; changing its value is unsupported. destroyfvkeyonstandby Destroy File Vault Key when going to standby mode. By default File vault keys are retained even when system goes to standby. If the keys are destroyed, user will be prompted to enter the password while coming out of standby mode. (value: 1 - Destroy, 0 - Retain). Since it is essential that the system fully powered down, you also need to set `hibernatemode` to 25 (suspend to disk). Settings may be adjusted independently for circumstances where the machine is attached to a charger, when running off a battery (in the case of a laptop), or when running off a UPS (if available). Settings can also be adjusted for all four scenarios simultaneously; this is the default option, for when no usage flag is specified. Power management options can be specified for different profiles by appending -c (charger), -b (battery), -u (UPS) or -a (all) flags. The following example will set the machine to sleep after 10 minutes and sleep the display after five minutes, but only when powered by the battery. pmset -b sleep 10 displaysleep 5 The following command will assign slightly different power management settings for circumstances where the machine is powered by the charger. Here, the machine is set to sleep after 30 minutes and the display is set to never sleep, but only when set by the charger. Issuing both commands will not interfere with each other. pmset -c sleep 30 displaysleep 0 Arguments can be entered in serial form to set or modify several power management parameters with one command. The following command will set the machine to never sleep ( sleep 0 ), enable the Sudden Motion Sensor ( sms 1 ), set the display to sleep after 20 minutes ( displaysleep 20 ), disable processor speed reduction ( reduce 0 ), enable intermediate display dimness ( halfdim 1 ), enable the machine to wake when the lid is opened ( lidwake 1 ), prevent the system from sleeping when a tty session (such as SSH) is active ( ttyskeepawake 1 ), disable waking the machine when the AC adapter is inserted ( acwake 0 ), disable an automatic restart after power is removed and restored ( autorestart 0 ), enable dynamic change of processor speed based on system load ( dps 1 ), enable wake on modem ring ( ring 1 ), enable wake on receipt of "magic" Ethernet packet ( womp 1 ), and disable hard disk sleep ( disksleep 0 ): pmset sleep 0 sms 1 displaysleep 20 reduce 0 halfdim 1 lidwake 1 ttyskeepawake 1 acwake 0 autorestart 0 dps 1 ring 1 womp 1 disksleep 0 Because the above example did not include a usage flag, the settings specified will apply to all usage scenarios. Subsequent commands that do specify a usage flag will only affect settings for that usage scenario. For instance, pmset -b sleep 10 will cause the machine to sleep after 10 minutes, but only when the battery is attached. All other settings will apply when the battery is attached, and all settings in the above example will apply when a charger or UPS is attached. At least as of Darwin 9.4 and OS X 10.5.4 "Leopard", all changes made through pmset are saved in a persistent preferences file at /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist . This file can be modified manually using the defaults command, but those changes will not be taken up immediately by the power management system. Manual edits of com.apple.PowerManagement.plist also stand the risk of being overwritten. The command pmset touch will reread existing settings from disk and apply them to the system. With autopoweroff enabled the machine will go into hibernate mode even if hibernatemode is 0. The value of autopoweroffdelay may be in seconds despite the man page (for Mavericks, Nov 9, 2012) documenting it as minutes. pmset sleepnow The following example will apply only to laptops when powered by the battery. It will set the machine to sleep after 5 minutes of inactivity, put the display to sleep after 2 minutes, and spin down the hard disk after 3 minutes. Only privileged users can issue this command. If the command is issued successfully and is without syntax errors, pmset will exit silently with an exit code of 0. To verify that the system took the new configuration, issue the command pmset -g . pmset -b sleep 5 displaysleep 2 disksleep 3 The following example will apply only to machines being powered by a UPS. It will set the machine to perform an emergency shutdown when 5 percent battery remains on the UPS, or 5 minutes estimated draw time remains, whichever comes first. Only privileged users can issue this command. If the command is issued successfully and is without syntax errors, pmset will exit silently with an exit code of 0. To verify that the system took the new configuration, issue the command pmset -g . pmset -u haltlevel 5 haltremain 5 The following example will apply for all usage scenarios. It will set the machine to wake on receipt of a "magic" Ethernet packet, wake if the modem detects a ring, and prevent the system from sleeping if a tty session is active. Only privileged users can issue this command. If the command is issued successfully and is without syntax errors, pmset will exit silently with an exit code of 0. To verify that the system took the new configuration, issue the command pmset -g . pmset -a womp 1 ring 1 ttyskeepawake 1 The following example sets a one-time scheduled power event. The machine will be set to shut down 01/10/2009 at 10:00 PM (10 January 2009 – Note the US centric MM/DD/YYY time syntax). Only privileged users can issue this command. If the command is issued successfully and is without syntax errors, pmset will exit silently with an exit code of 0. To verify that the system took the new configuration, issue the command pmset -g sched . pmset schedule shutdown "01/10/2009 22:00:00" The following example sets a repeating power event. The machine will wake or power on every weekday at 8:00 AM. Only privileged users can issue this command. If the command is issued successfully and is without syntax errors, pmset will exit silently with an exit code of 0. To verify that the system took the new configuration, issue the command pmset -g sched . pmset repeat wakeorpoweron MTWRF 08:00:00 Here, example output from pmset -g . At the time, the machine was being powered by the charger, while simultaneously charging the battery. The command prints the current configuration. $ pmset -g Active Profiles: Battery Power -1 AC Power -1* Currently in use: sleep 0 sms 1 displaysleep 20 reduce 0 halfdim 1 lidwake 1 ttyskeepawake 1 acwake 0 autorestart 0 dps 1 ring 1 womp 1 disksleep 0 Here, example output from pmset -g sched . In this example, the machine has already been configured for a repeating event to start or wake up every weekday at 8:00 AM. The command prints the repeating event; note that the next such occurrence appears as a scheduled power event. $ pmset -g sched Repeating power events: wakepoweron at 8:00AM weekdays only Scheduled power events: [0] wakeorpoweron at 08/04/08 08:00:00 by Repeating Here, example output from pmset -g . At the time, the machine was being backed up. The output shows the PID for the backup program. $ pmset -g | grep sleep disksleep 10 sleep 0 (imposed by 33927) displaysleep 5 $ ps -ef | grep 33927 0 33927 1 0 9:22am ?? 10:54.97 /System/Library/CoreServices/backupd

References

pmset(1) manual page at Apple Developer Connection Power Management and Scheduling via Command Line at uMac, University of Utah standbydelayhigh and standbydelay low at Apple Discussions sys-suspend for Solaris systems poweradm for Solaris systems

Text derived from https://en.wikipedia.org/w/index.php?oldid=1363780032 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

No external citation was extracted for this revision. That is a statement about the source, not a claim that none exists.