6

How do you list a computer's video devices via terminal? Is there a command that lists them?

keith
  • 141
  • 2
  • 3

3 Answers3

13

To list video output devices (e.g. monitors),

$ system_profiler SPDisplaysDataType

This produces output that looks like this:

Graphics/Displays:

    Intel HD Graphics 4000:

      Chipset Model: Intel HD Graphics 4000
      Type: GPU
      Bus: Built-In
      VRAM (Dynamic, Max): 1536 MB
      Vendor: Intel
      Device ID: 0x0166
      Revision ID: 0x0009
      Metal: Supported, feature set macOS GPUFamily1 v4
      Displays:
        Color LCD:
          Display Type: LCD
          Resolution: 1440 x 900 (Widescreen eXtended Graphics Array Plus)
          UI Looks like: 1440 x 900
          Framebuffer Depth: 24-Bit Color (ARGB8888)
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: No
          Connection Type: Internal

To list video input devices (e.g. webcams),

$ system_profiler SPCameraDataType

This produces output that looks like this:

Camera:

    FaceTime HD Camera (Built-in):

      Model ID: UVC Camera VendorID_1452 ProductID_34064
      Unique ID: 0x1a11000005ca8510

To get just the device names, filter the list accordingly:

$ system_profiler SPCameraDataType | grep "^    [^ ]" | sed "s/    //" | sed "s/://"

This produces output that looks like this:

FaceTime HD Camera (Built-in):
Al Sweigart
  • 11,566
  • 10
  • 64
  • 92
Ian
  • 11,280
  • 3
  • 36
  • 58
1

system_profiler

khachik
  • 28,112
  • 9
  • 59
  • 94
1
system_profiler SPDisplaysDataType

or

ioreg | grep -i display

Note that the system_profiler command is case sensitive.

omicron
  • 11
  • 1