Reference’s
1) http://www.makelinux.net/ldd3/chp-13-sect-2.shtml
$ cd /sys/bus/usb/devices
/sys/bus/usb/devices# ls -al usb* usb1 -> ../../../devices/pci0000:00/0000:00:1d.7/usb1 usb2 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2 usb3 -> ../../../devices/pci0000:00/0000:00:1d.1/usb3 usb4 -> ../../../devices/pci0000:00/0000:00:1d.2/usb4 usb5 -> ../../../devices/pci0000:00/0000:00:1d.3/usb5
This shows that it has 5 root hubs. Now, lets try to correlate it with lsusb. A simple shell script which will print only RootHubs available on your machine.
[bash] #!/bin/sh TOTAL_BUS_NUM=$1 for (( i=1; i <= $TOTAL_BUS_NUM; i++ )) do lsusb -s $i:1 done [/bash]Run it as “bash lsusb.sh”
:~/USB$ bash lsusb.sh 5 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub