开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜