List all connected media devices in Linux

0
2
List all connected media devices in Linux
List all connected media devices in Linux

A quick tip to list all connected media devices in Linux. We will install and use v4l2 utility for the job.

Depending on Linux distros, you have to use appropriate command to install:

# Ubuntu / Debian-based
$ sudo apt-get update

$ sudo apt-get install -y v4l-utils


# CentOS / Fedora

$ sudo yum makecache

$ sudo yum -y install v4l-utils


# Alpine

$ apk update

$ apk add v4l-utils

After installation, confirm the utility by issuing this command:

$ v4l2-ctl --info

To list all connected media devices in Linux, use below command:

$ v4l2-ctl --list-devices
Logitech Webcam C920 (usb-0000:00:14.0-1):
    /dev/video0

If you have more than one connected devices, it will be listed accordingly.

Have fun!