You can use these commands to do various things, from shutting down and restarting your Mac to checking hidden power management information—all in Terminal. So, if you’re looking to customize your power management, the information here should help you get started.
1. Put Your Mac to Sleep
One of the simple power management actions you can do in Terminal is putting your Mac to sleep. Type in the following command to put your Mac to sleep:
Please note that doing this (and any of the commands that start with ‘sudo’) needs you to have admin privileges. It will prompt you for a password, and your Mac will go to sleep as soon as you enter it.
2. Set Display Sleep Time
If you’d like to change how long it takes for your Mac’s display to go off, type “sudo pmset” followed by “displaysleep” and the time in minutes. For example, setting the display to sleep in 15 minutes will look like this:
You can also specify what power source you would like your command to act on:
-b: battery
-c: power adapter
-u: UPS
-a: all power sources
Therefore, if you would like your display to sleep after 15 minutes of inactivity while on battery power, your command will look like this:
Just replace the -b in the command with the proper value according to what power source you want it to act on.
3. Change How Long it Takes For Your Mac to Sleep
Putting your Mac to sleep differs from turning off the display. When your Mac is asleep, it won’t be able to run background processes like playing music or downloading media. However, for your Mac to go to sleep, the display needs to go off first. Here’s an example:
The above command will put your computer to sleep 10 minutes after your Mac’s display goes off. So, if you have a Mac with a display set to turn off after 30 minutes, it will take 40 minutes of inactivity before your Mac goes to sleep.
4. Enable or Disable Power Nap
If your Mac supports Power Nap, you can enable or disable it in Terminal. In short, Power Nap allows your Mac to occasionally wake up from sleep and ensure the software runs smoothly in the background. You can read more about what Power Nap on a Mac does in our dedicated article.
Here’s the command to turn on Power Nap:
If you want to turn it off, simply change the value from “1” to “0”.
5. Enable or Disable Wake for Network Access
macOS comes with a feature that allows your Mac to access the internet while it’s asleep to keep your apps up to date. You can find this in System Settings > Battery > Options. However, if you would like to enable it in Terminal, enter the following command:
Once again, change “1” to “0” if you want to turn it off.
6. Schedule Wake, Shutdown, and Restart
Once upon a time, you could do this in the macOS settings app. But now, you have to use Terminal to schedule a startup, shutdown, and restart on macOS Ventura. You can set two types of schedules: a one-time schedule and a repeat schedule.
If you would like to set your Mac to wake at a specific time in the future, for example, November 16th, 2025, at 9:30 am, then your command will look like this:
To shut down or restart, replace “wake” in the command with “shutdown” or “restart” accordingly. When you change the date and time, conform to the MM/DD/YY and HH/MM/SS formats, or your command won’t work.
If you would like to set a schedule for repeating wakes, shutdowns, or restarts, then you have to familiarize yourself with the command values for the days of the week: Monday: M; Tuesday: T; Wednesday: W; Thursday: R; Friday: F; Saturday: S; Sunday: U.
Therefore, if you would like to set a repeat schedule for your Mac to turn on automatically by 05:30 am on weekdays, your command will look like this:
You can replace “wakeorpoweron” with “shutdown” or “restart.”
7. Enable or Disable Auto-Restart After Power Loss
The autorestart Terminal command turns your Mac on after unexpected power loss, kernel panic, or system crash. This is especially useful for desktops or other stationary Macs used as servers because those must be back up and running as soon as possible.
Type this command to turn on automatic restart:
Change “1” to “0” to turn it off.
8. Enable or Disable Proximity Wake
Newer Macs have a feature that automatically wakes it up once a paired iPhone or Apple Watch (with the same Apple ID) comes close enough to the Mac. This feature is called Proximity Wake, and you can activate it with the pmset utility in Terminal.
Enter the following command to activate it:
If you’d like to turn it off, simply change “1” to “0” in the command line.
9. Check Your Power Management Status
If you would like to see what your power management settings are, you should type in the following command:
This command will display a list of common power management settings values.
However, if you’re looking for a list of your scheduled power events, type in the following command:
10. Return Your Power Management Settings to Default
To return all your power management settings to default (much like clicking “Restore Defaults” in the System Preferences app), enter the following command:
Doing this won’t change your scheduled repeat events, though; you can cancel those with this command:
If you would like to remove all scheduled events, then you will have to type in the following:
You Can Do Much More With Pmset
While this list covers some of the more useful commands you can do with the pmset utility, it is by no means an extensive collection of the possibilities. There’s still so much more you can do with power management in Terminal if you’re willing to do some research.
However, we hope you plan to use at least some of the Terminal commands here to fine-tune and improve your Mac experience.