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]
精彩评论