In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article to share with you is about how to use the lsusb command in Linux to display information about USB devices, Xiaobian feels quite practical, so share it with you to learn, I hope you can gain something after reading this article, not much to say, follow Xiaobian to see it.
In Linux we use the lsusb command to list USB devices and their properties. lsusb is used to display information about USB buses and connected devices in the system. Here is how to install and use it.
system environment
System: Centos7
Install usbutils
There is no lsusb command in the default Centos7 system. We need to install the usbutils installation package to use lsusb:
[root@localhost ~]# yum -y install usbutils List usb device information
lsusb is used to display information about the USB bus in the system and its connected devices. Run lsusb as follows:
[root@localhost ~]# lsusb Bus 001 Device 010: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 055: ID 0951:1665 Kingston Technology Digital DataTraveler SE9 64GB Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Lsusb displays drivers and devices connected within the system.
The above output is explained as follows:
Bus 001 Device 055: ID 0951:1665 Kingston Technology Digital DataTraveler SE9 64GB
Bus 001: Indicates the first usb controller, which can use lspci| grep USB View host has several USB controllers
Device 055: Indicates the device number assigned by the system to this Kingston storage device
ID: ID indicating USB device
Kingston Technology Digital DataTraveler SE9 64GB: Indicates its manufacturer name and device name
We also see that the USB 2.0 root hub driver and USB 1.1 root hub driver are included with the system.
Display usb information using tree type
Use the-t option to display usb information in a tree structure:
[root@localhost ~]# lsusb -t /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
The numbers 12M, 480M, and 5000M represent USB transfer speeds.
12M means 12Mbit / s, which is USB 1.0 / 1.1 type
480M means 480Mbit / s, which is USB 2.0 type.
5000M stands for 5Gbit / s, which is USB 3.0 type.
Linux identifies USB device details from/usr/share/hwdata/usb.ids'. The vendor and device name listed in lsusb are identified from this file.
How to list USB details
Use the-v parameter to view usb details:
[root@localhost ~]# lsusb -v | less Bus 001 Device 056: ID 0951:1665 Kingston Technology Digital DataTraveler SE9 64GB Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x0951 Kingston Technology idProduct 0x1665 Digital DataTraveler SE9 64GB bcdDevice 1.00 iManufacturer 1 Kingston iProduct 2 DataTraveler 2.0 iSerial 3 08606E6B6612FD50771C2A8B bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 8 Mass Storage bInterfaceSubClass 6 SCSI bInterfaceProtocol 80 Bulk-Only iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 255 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0200 1x 512 bytes bInterval 255 Device Qualifier (for other device speed): bLength 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 Device Status: 0x0000 (Bus Powered) Find how many USB devices are connected
To find the number of linked devices, use the following command:
[root@localhost ~]# find /dev/bus /dev/bus /dev/bus/usb /dev/bus/usb/002 /dev/bus/usb/002/003 /dev/bus/usb/002/002 /dev/bus/usb/002/001 /dev/bus/usb/001 /dev/bus/usb/001/056 /dev/bus/usb/001/010 /dev/bus/usb/001/001
Using the lsusb command in conjunction with the-D parameter, you can output detailed information about a particular device. The following examples view Kingston storage device details:
[root@localhost ~]# lsusb -D /dev/bus/usb/001/056
Find mass storage devices
lsusb -v provides us with very detailed information, we can use the grep command to find the specified information, the following filter idVendor and Mass Storage, to get mass storage devices:
[root@localhost ~]# lsusb -v |grep -Ei '(idVendor|Mass\ Storage)' idVendor 0x0bda Realtek Semiconductor Corp. idVendor 0x0951 Kingston Technology bInterfaceClass 8 Mass Storage idVendor 0x1d6b Linux Foundation idVendor 0x0e0f VMware, Inc. idVendor 0x0e0f VMware, Inc. idVendor 0x1d6b Linux Foundation
You can see that only devices with idVendor Kingston Technology are mass storage devices.
The above is how to use the lsusb command in Linux to display information about USB devices. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.