System Preferences in Sierra seems to know when a UPS is present. How do I check this from the command line?

3 Answers 3


Use the command system_profiler SPPowerDataType | grep "UPS Installed".

This will return something along the lines of UPS Installed: No


You can use Power Manager's pmctl tool to check for a connected UPS, see Scripting Batteries and UPS on Mac OS X.

pmctl can output in a range of formats to make scripted parsing easier, use the -f flag for this:

  • JSON
  • perl
  • XML

Power Manager scripting UPS

Alternatively, you could search the output of system_profiler SPUSBDataType to find the matching UPS.

I wrote Power Manager, so feel free to ask technical questions.


Parsing the output of system_profiler SPPowerDataType provides a line status UPS Installed : Yes | No which seems to be flipping with me (un)plugging the USB cable from the UPS.

  • Is this supposed to be part of your question? Perhaps you should edit the question to add this as extra detail and delete this as an answer.
    – Monomeeth
    Commented Feb 7, 2017 at 22:22
  • 1
    No. It's the answer to my question, which I found minutes after posting the question :) Commented Feb 8, 2017 at 2:42

You must log in to answer this question.

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