list video devices via terminal
How do开发者_如何学运维 you list a computer's video devices via terminal? Is there a command that lists them?
To list video output devices (e.g. monitors),
$ system_profiler SPDisplaysDataType
To list video input devices (e.g. webcams),
$ system_profiler SPCameraDataType
To get just the device names, filter the list accordingly:
$ system_profiler SPCameraDataType | grep "^ [^ ]" | sed "s/ //" | sed "s/://"
system_profiler
system_profiler SPDisplaysDataType
or
ioreg | grep -i display
Note that the system_profiler command is case sensitive.
精彩评论