开发者

Get list of USB devices connected currently and their dev file in BASH

开发者 https://www.devze.com 2023-01-06 22:02 出处:网络
What is the bash command for开发者_运维百科 detecting all currently connected USB devices and getting the /dev/tty... file that corresponds to the USB device.Give lsusb a try; for the corresponding fi

What is the bash command for开发者_运维百科 detecting all currently connected USB devices and getting the /dev/tty... file that corresponds to the USB device.


Give lsusb a try; for the corresponding file I plug in the device and use dmesg, but there sure is a better way...


This can show all USB devices, including devices that you don't have drivers.

system_profiler SPUSBDataType


Try this:

lsblk -p -S -o  NAME,TRAN  | grep usb


dmesg | grep ttyUSB | grep -v grep | grep -o ttyUSB[0-9]
0

精彩评论

暂无评论...
验证码 换一张
取 消