Skip to content

lsusb

USB device inspection, filtering, and parsing


Display connected usb devices

lsusb

Display connected usb devices in a tree view

lsusb -t

Print usb devices with increased verbosity

lsusb -v

Print "Show only devices with the specified vendor and product ID numbers (in hexadecimal)"

$ lsusb -d 2357:0109
Bus 001 Device 032: ID 2357:0109 TP-Link TL-WN823N v2/v3 [Realtek RTL8192EU]

Show only devices with specified device and/or bus numbers

lsusb -s 001:032

Format lsusb output as bus:device: description using awk

lsusb | awk '{printf "%s:%s: %s\n", $2, substr($4,1,length($4)-1), substr($0, index($0,$7))}'

Format lsusb output as vendor:product description using awk

lsusb | awk '{print $6, substr($0, index($0,$7))}'

Generate lsusb -d vendor:product commands from lsusb output using awk

lsusb | awk '{print "lsusb -d", $6}'

Parse Bus and Device from lsusb and generate lsusb -s bus:devnum

lsusb | awk '{dev=$4; sub(/:/,"",dev); print "lsusb -s", $2 ":" dev}'

Execute all at once of the generated commands for bus:devnum

lsusb | awk '{d=$4; sub(/:/,"",d); print "lsusb -s", $2 ":" d}' | sh

Dump all data for a connected usb device by /dev/bus/usb/bus/device

lsusb -D /dev/bus/usb/001/001