On OS X 10.8, users can disable Notification Center for a single day. Is there a way to check if it is enabled from the command line?.


You actually can find out if the Do Not Disturb is currently enabled or disabled. Notification Center drops a plist in the following location that you can read the value of. Run the following to find the plist file:

ls ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist

Now, you can read the value from the plist you just found by using:

defaults read ~/Library/Preferences/ByHost/com.apple.notificationcenterui.8D3EA20D-8D7F-52E2-9F99-BC17A13A3F0E.plist

NOTE: your actual filename may be different than what I have listed above.

You will see a key called "doNotDisturb" and it will either have a value of 1 or 0 (enabled or disabled)

You can also change it's status by doing:

defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.8D3EA20D-8D7F-52E2-9F99-BC17A13A3F0E.plist doNotDisturb 1


defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.8D3EA20D-8D7F-52E2-9F99-BC17A13A3F0E.plist doNotDisturb 0

To make the change take effect, you'll need to restart Notification Center by typing:

killall NotificationCenter

I've actually written a very simple Automator script so now I can enable/disable the Do Not Disturb for Notification Center with a keyboard shortcut. Very handy. :)

  • Unfortunately, setting this on/off does not work on El Capitan. Nov 27 '15 at 23:22
  • Doesn't work on Yosemite either Jan 27 '16 at 13:57
  • This won't work. 1. this UUID is specific for you. 2. killall NotificationCenter will reset the settings to default but not reload the settings.
    – Simba
    Nov 7 '19 at 17:26
  • This doesn't work in 10.5
    – jerlich
    Jan 20 at 3:04

To get the Do not disturb status in Yosemite, just enter the following in your terminal:

defaults read ~/Library/Preferences/ByHost/com.apple.notificationcenterui.plist doNotDisturb
  • 1
    This is much better than the accepter answer IMO, as (1) you just copy and paste it and (2) in my system (MacOS Sierra) this works and the accepted solution doesn't (it says "domain does not exist", the file exists but it is empty). Therefore I really like this one. Dec 16 '20 at 9:53

Probably the best way I can think of is to install terminal notifier and send it a message from the terminal.

Install Terminal Notifier

Terminal notifier can be installed through Ruby Gems


sudo gem install terminal-notifier

Send NC a message


terminal-notifier -message "The notification center is running" -title "NC Status"

If notification center is running you'll get a message that says "The notification center is running"

  • 2
    The above worked well for me but it's a manual solution rather than a programmatic status indication so I'm not giving it a +1 as an answer to this question. It was however very useful in other respects. Jun 29 '14 at 20:41
  • Giving this an upvote is not the same as selecting the answer as correct. If the answer helped you but didn't answer the question you can give it an upvote. if it answered your question then click on the checkmark icon on the left side.
    – Natsfan
    Nov 7 '19 at 20:29

Setting of the Notification center is stored in the ~/Library/Preferences/ByHost folder, which means it's a machine-specific settings.

You can use defaults -currentHost command to read the settings within. -currentHost is used to specify the ByHost setting not the common user specific one stored in ~/Library/Preferences.

defaults -currentHost read com.apple.notificationcenterui doNotDisturb

Output value 1 means it's activated, 0 for disabled.

In fact, the above command is reading options from ~/Library/Preferences/ByHost/com.apple.notificationcenterui.<your-UUID>.plist file.

Caveats: Setting ByHost options with defaults -currentHost write doesn't work. The options are indeed written into the file, but it's not reloaded by the corresponding daemon. I guess this is a bug.



At the moment, the ways to interact with Notification Center programmatically (including via the command line) are pretty limited. As InfluenceJamie noted, there's terminal-notifier, which allows you to send notifications from the command line, but sending notifications is pretty much all programs can do at the moment. From my reading of the developer documentation, programs can only send and get information about the specific notifications they send, no status information for Notifcation Center itself, or other notifications. There's also no Applescript interface.

So at the moment, you're limited to manually testing whether a notification goes through, as InfluenceJamie suggested, or hoping that someone figures out Apple's private APIs and makes a command line interface.

  • In MacOS every preference is stored in some plist files, so there must be some "defaults read" stuff to do what I'm looking for.
    – user732274
    Aug 5 '12 at 22:54
  • 1
    Well, that's a possibility of course, but the defaults are more for permanent preferences - a temporary setting might not be stored in the defaults. However that's probably your best bet if InfluenceJamie's suggestion doesn't work for you.
    – robmathers
    Aug 5 '12 at 23:01
  • Where should this be stored if not in a plist?
    – user732274
    Aug 5 '12 at 23:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .