Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

bash

unix

usb

What is the bash command for detecting all currently connected USB devices and getting the /dev/tty... file that corresponds to the USB device.

like image 570
Mohit Deshpande Avatar asked Jul 14 '10 09:07

Mohit Deshpande


Video Answer


3 Answers

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

like image 153
Alberto Zaccagni Avatar answered Nov 02 '22 17:11

Alberto Zaccagni


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

system_profiler SPUSBDataType
like image 37
vudduu Avatar answered Nov 02 '22 19:11

vudduu


Try this:

lsblk -p -S -o  NAME,TRAN  | grep usb
like image 43
Sergi Mayordomo Avatar answered Nov 02 '22 18:11

Sergi Mayordomo