
Quick Answer
Open Terminal and run:
pmset -g assertions
Look for active assertions, especially entries showing PreventUserIdleSystemSleep or PreventSystemSleep. The process name, application name, or assertion owner listed beside an active entry can identify what is keeping your Mac awake.
To see recent sleep and wake activity, run:
pmset -g log | grep -iE 'sleep|wake|darkwake|maintenance'
These commands inspect macOS power-management information. They do not change your Mac’s settings or close applications.
Why Your Mac May Not Sleep
macOS can temporarily prevent sleep when an application or system service needs the Mac to remain available. Common examples include:
- A video, music, or conferencing app that is still active
- A file transfer, backup, or synchronization task
- An external drive being used
- A system update or maintenance task
- A process holding a power-management assertion
- A connected device or network activity
An assertion is a request made by an application or service to prevent a particular type of sleep. Terminal can display these requests, making it easier to identify the source.
Before changing anything, save your work. Some troubleshooting steps may require quitting an application, disconnecting a device, or restarting your Mac.
Check Active Sleep Assertions
The most useful first command is pmset -g assertions. It displays power-management assertions currently held by applications and system services.
Run this command:
pmset -g assertions
This command only reports the current state. It does not enable, disable, or remove any assertion.
What to look for
The output can contain categories such as:
PreventUserIdleSystemSleep: prevents sleep caused by inactivityPreventSystemSleep: prevents the system from entering sleepNoIdleSleepAssertion: another form of idle-sleep preventionExternalMedia: indicates that external media is involvedListed by owning process: identifies processes associated with the assertions
Focus on entries whose value is greater than zero or whose status indicates that they are active. An inactive category does not explain the current sleep problem.
The owning process may be an application name, a background service, or a process identifier. If an application is listed, check whether it is playing media, transferring files, backing up data, or waiting for another task to finish.

pmset -g assertions
Display Only the Lines Most Relevant to Sleep
The full pmset report can be long. You can filter it with grep to find lines containing common sleep-related terms.
Run:
pmset -g assertions | grep -iE 'assertion|sleep|process|owner|pid'
grep -iE searches without distinguishing uppercase and lowercase letters. The -E option allows several search terms to be combined.
This filtered view can help you locate:
- The assertion category
- The process or application holding it
- A process ID, commonly called a PID
- Text indicating whether an assertion is active
Filtering can also hide useful context, so use the unfiltered command again if the shortened result is unclear.
Identify the Application or Process
If the output gives you a process ID, you can inspect that process with ps. Replace PID with the number shown in your Terminal output.
ps -p PID -o pid,ppid,user,stat,etime,command
For example, if the process ID is 1234, the command would be:
ps -p 1234 -o pid,ppid,user,stat,etime,command
This command reports information about the selected process, including its ID, parent process, status, how long it has been running, and the command used to start it. It does not stop or modify the process.
If you do not recognize the process, do not terminate it immediately. Some system services are necessary for macOS to operate normally. First, search for the application associated with the process or check whether a known task—such as a backup or file transfer—is running.
If you need help investigating an unresponsive application, see How to Find and Stop a Frozen Process Using Terminal on a Mac.
Check the Sleep and Wake History
The assertion report shows what is preventing sleep now. The power-management log can help explain what happened earlier.
Run:
pmset -g log | grep -iE 'sleep|wake|darkwake|maintenance'
This command asks pmset for power-management log entries, then filters the results for common sleep and wake terms:
sleep: entries related to entering sleepwake: entries related to wakingdarkwake: background wake activitymaintenance: maintenance-related activity
The log may include many entries. Look near the most recent lines and compare the times with when you expected the Mac to sleep or when you noticed it awake.
This history is diagnostic only. It does not alter the sleep schedule or remove log entries.

pmset -g log | grep -iE 'sleep|wake|darkwake|maintenance'
Check Whether an External Device Is Involved
External devices can sometimes keep a Mac active or trigger wake events. Disconnecting devices one at a time can help identify the source.
Before disconnecting anything, finish or pause file transfers and eject external storage properly. Removing a drive while it is being used can cause data loss or file-system problems.
To view mounted disks and volumes, run:
diskutil list
This command lists disks and partitions recognized by macOS. It does not erase, repartition, or modify a disk.
If you see an external drive, card, or other storage device, check whether an application is using it. Quit the related application or eject the volume from Finder before disconnecting it.
To eject a specific volume safely, use:
diskutil eject /Volumes/VolumeName
Replace VolumeName with the exact volume name. For example:
diskutil eject /Volumes/Backup
Ejecting unmounts the volume; it does not erase its contents. If macOS reports that the volume is busy, close files and applications using it, then try again. Do not force removal while data may be writing.
Check for Processes Using a Lot of Activity
A process that is actively working may be responsible for an assertion. Terminal’s top command provides a live process view.
Run:
top -o cpu
This displays processes ordered by CPU use. Watch for familiar applications or services that remain active while the Mac should be idle.
Press q to quit top. The command does not change process settings.
High CPU use alone does not prove that a process is preventing sleep. Use it together with pmset -g assertions and the sleep log. A backup, indexing task, conversion, or synchronization process may be expected to use resources temporarily.
You can also check whether a process is reading from or writing to an external volume by looking at the application’s own status indicators. Do not stop a process simply because it appears near the top of the list.
What to Do After Finding the Cause
Once you identify the application or task, use the least disruptive solution:
- Finish the task. A backup, upload, download, or synchronization job may release its assertion when complete.
- Pause the task. Use the application’s pause control when available.
- Quit the application normally. Save your work first, then use the application’s Quit command.
- Disconnect an unnecessary device. Eject external storage before unplugging it.
- Restart the Mac. A restart can clear a stuck temporary condition, but save all work first.
Avoid deleting preference files or changing system power settings as a first step. Those actions may create new problems without addressing the process that is currently holding the assertion.
If an application refuses to quit, try quitting it normally again after saving. Force quitting can cause unsaved work to be lost. Use Apple menu > Force Quit only when necessary.
Advanced Check: Review Current Power Settings
You can display the current power-management settings with:
pmset -g custom
This command reports settings for available power sources, such as battery or power adapter. It does not change them.
These settings describe sleep timers and related behavior, but they do not always identify the application preventing sleep. An active assertion is usually more useful when your Mac refuses to sleep right now.
Do not use sudo pmset commands unless you know exactly which setting you are changing. Commands that modify power settings can affect battery life and sleep behavior. If you do change a setting, record its original value first so you can restore it with the same command and the previous value.

pmset -g custom
Troubleshooting
pmset returns an error
Confirm that you entered the command exactly as shown, including spaces and hyphens. Run the command in the built-in Terminal app located in Applications > Utilities.
If a command still fails, restart the Mac and try again. A restart does not permanently remove applications or files, but save open work before restarting.
The output shows no active assertions
Assertions can be temporary. Run the command while the problem is occurring:
pmset -g assertions
If the Mac is awake only occasionally, review the recent log instead:
pmset -g log | grep -iE 'sleep|wake|darkwake|maintenance'
Also check connected devices, scheduled tasks, backups, and applications playing media.
The process name is unfamiliar
Do not delete the process or terminate it based only on its name. Use ps to view its command and parent process:
ps -p PID -o pid,ppid,user,stat,etime,command
Replace PID with the identifier from your output. If the process belongs to macOS, leave it running unless you have a specific reason to stop it. If it belongs to a third-party application, quit the related application normally and check whether the assertion disappears.
The Mac sleeps but wakes again
Use the sleep log command and look for wake or darkwake entries:
pmset -g log | grep -iE 'sleep|wake|darkwake|maintenance'
A wake event does not necessarily mean that sleep failed. The Mac may have entered sleep and then awakened for maintenance, a device event, network activity, or another scheduled reason. Disconnecting external devices temporarily can help isolate the cause.
You want to confirm that the assertion disappeared
After quitting an application or allowing a task to finish, run:
pmset -g assertions
Compare the active entries with the earlier report. The relevant process or assertion should no longer appear as active. If it remains, the application may still be running in the background, or another process may be holding a similar assertion.
Frequently Asked Questions
Does pmset -g assertions change my Mac’s settings?
No. It displays current power assertions. It does not disable sleep, close applications, or modify power-management preferences.
Can Terminal tell me exactly why my Mac will not sleep?
Often, it can identify an application or process holding an active assertion. However, sleep behavior can also involve external devices, scheduled activity, network events, or temporary system work. Use the assertion report and power-management log together.
Is it safe to use grep with these commands?
Yes. In these examples, grep only filters displayed text. It does not modify the underlying log or power settings.
Should I kill the process that is preventing sleep?
Not as a first step. Save your work and quit the associated application normally. Force quitting or terminating a process can cause unsaved data loss and may interrupt backups, transfers, or other operations.
How can I stop troubleshooting and return to normal?
The diagnostic commands in this guide do not make persistent changes. Close Terminal when finished. If you changed an application state, reopen the application or resume its task. If you disconnected an external volume, reconnect it after confirming that it was safely ejected.
Final Thoughts
Start with pmset -g assertions to find active requests preventing sleep, then use the power-management log to investigate earlier sleep and wake events. Identify the responsible application or process before changing anything, and prefer finishing, pausing, or normally quitting that task over force quitting or modifying system power settings.