Skip to content

pmset MacOS command

The pmset command on MacOS allows users to view and modify power management settings. With pmset, users can optimize system performance, improve battery life, and customize sleep settings. This powerful command-line tool provides detailed control over how the Mac manages power, including setting sleep and wake schedules, adjusting display sleep times, and optimizing battery usage. By understanding and utilizing the pmset command effectively, users can tailor their Mac’s power settings to best suit their needs.

pmset Syntax:

Terminal window
pmset [option] [parameter]

pmset Options:

OptionDescription
-gDisplay the current Power Management settings
-bSet preferences for battery power
-cSet preferences for charging power
-uSave settings to be the default for all users
-aSet preferences for both battery and charging power
-sSave settings to be the default for the active power source
-battSwitch to settings for battery power
-acSwitch to settings for AC power
-aApply settings to all power sources
-uApply settings to the currently active settings
-bactSwitch to battery settings and apply them
-reactiveReturn the system to a default state
-gcustomShow custom power management settings
-gupsShow UPS settings
-gassertionsShow power assertions

Parameters:

ParameterDescription
sleepSet the system sleep timer value
displaysleepSet the display sleep timer value
disksleepSet the hard disk sleep timer value
wompSet the Wake On LAN value
ringSet the Wake On Modem value
autopoweroffSet the autopoweroff delay time
autopoweroffdelaySet the autopoweroff delay time in seconds

pmset Command Usage Examples:

Set the Display Sleep Timer to 15 Minutes

Terminal window
pmset displaysleep 15

Sets the display sleep timer to 15 minutes.

Put the System into Sleep Mode

Terminal window
pmset sleepnow

Puts the system into sleep mode.

Schedule a Sleep Timer for 10 Minutes

Terminal window
pmset sleep 10

Schedules a sleep timer for 10 minutes.

Disable Sleep Mode

Terminal window
pmset -a disablesleep 1

Disables sleep mode for the system.

Check Current Power Management Settings

Terminal window
pmset -g

Displays the current power management settings on the system.

How do I use pmset in MacOS?

To use the pmset command in bash, execute the following command:

Terminal window
pmset --option <value>

What are some common options for the pmset command in MacOS?

Common options for the pmset command include setting sleep preferences, modifying hibernation settings, and configuring power source behaviors.

How can I view the current power management settings using pmset?

To view the current power management settings with pmset, you can execute the following command:

Terminal window
pmset -g

How do I set the computer to never sleep using pmset in MacOS?

To set the computer to never sleep using the pmset command, use the following command:

Terminal window
pmset sleep 0

Can I schedule a specific time for the computer to go to sleep using pmset?

Yes, you can schedule a specific time for the computer to go to sleep by using the following command format:

Terminal window
sudo pmset repeat shutdown HH:MM:SS

How can I adjust the hibernation mode settings with pmset in MacOS?

To adjust the hibernation mode settings with pmset, you can use the following command:

Terminal window
sudo pmset hibernatemode <value>

Is it possible to create custom sleep settings for different power sources using pmset?

Yes, you can create custom sleep settings for different power sources by using the “c” option followed by the power source identifier. For example:

Terminal window
pmset -c sleep 30

How do I restore the default power management settings with pmset in MacOS?

To restore the default power management settings using pmset, you can execute the following command:

Terminal window
sudo pmset -a hibernate 1

Applications of the pmset command

  • Adjusting power management settings
  • Displaying current power source and settings
  • Managing battery health and charging behavior
  • Setting preferences for sleep and power saving modes
  • Configuring system behavior when on battery power vs. connected to AC power
  • Monitoring power usage and optimizing battery life