What is in my computer?!?! Not gremlins! After a year of running a computer I usually forget what some of my hardware entails. That’s where lspci and lsusb can come in handy. There is also the lshw command which requires root, but I will discuss that at a later date. This article will focus on lspci and lsusb.

lspci will display all hardware that is currently connected to the PCI bus of your motherboard.

‘lspci’ Output With Various Commands

Executing the lspci command will display basic information about the devices in your computer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$ lspci
00:00.0 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)
00:00.1 RAM memory: nVidia Corporation C51 Memory Controller 0 (rev a2)
00:00.2 RAM memory: nVidia Corporation C51 Memory Controller 1 (rev a2)
00:00.3 RAM memory: nVidia Corporation C51 Memory Controller 5 (rev a2)
00:00.4 RAM memory: nVidia Corporation C51 Memory Controller 4 (rev a2)
00:00.5 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)
00:00.6 RAM memory: nVidia Corporation C51 Memory Controller 3 (rev a2)
00:00.7 RAM memory: nVidia Corporation C51 Memory Controller 2 (rev a2)
00:02.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)
00:04.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1)
00:05.0 VGA compatible controller: nVidia Corporation C51 [GeForce 6150 LE] (rev a2)
00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2)
00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3)
00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3)
00:0a.2 RAM memory: nVidia Corporation MCP51 Memory Controller 0 (rev a3)
00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)
00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3)
00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev a1)
00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1)
00:0f.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1)
00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2)
00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)
00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
03:05.0 FireWire (IEEE 1394): Agere Systems FW322/323 (rev 70)
03:08.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)
03:09.0 Communication controller: Conexant Systems, Inc. HSF 56k Data/Fax Modem

As you can see, we are given basic information as to what device(s) are currently in my system. To output more information for each item, you can use the -v command for more verbose output. Here is an example of more detailed ethernet output, I am running as root to get Kernel driver information.

1
2
3
4
5
6
7
8
9
10
11
12
# lspci -v
03:08.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05)
 Subsystem: Intel Corporation Device 1376
 Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16
 Memory at fdda0000 (32-bit, non-prefetchable) [size=128K]
 Memory at fddc0000 (32-bit, non-prefetchable) [size=128K]
 I/O ports at ac00 [size=64]
 Expansion ROM at fdc00000 [disabled] [size=128K]
 Capabilities: [dc] Power Management version 2
 Capabilities: [e4] PCI-X non-bridge device
 Kernel driver in use: e1000
 Kernel modules: e1000

There are a few more complex commands that lspci provides, including the bus tree. These reference the first field on the first line of our output:
03:08.0 Ethernet controller: Intel Corporation 82541PI Gigabit Ethernet Controller (rev 05). The 03:08.0 is where the device fits in the bus tree. Lets output the bus tree to compare:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# lspci -t
-[0000:00]-+-00.0
           +-00.1
           +-00.2
           +-00.3
           +-00.4
           +-00.5
           +-00.6
           +-00.7
           +-02.0-[0000:01]--
           +-04.0-[0000:02]--
           +-05.0
           +-09.0
           +-0a.0
           +-0a.1
           +-0a.2
           +-0b.0
           +-0b.1
           +-0d.0
           +-0e.0
           +-0f.0
           +-10.0-[0000:03]--+-05.0
           |                 +-08.0  <------ The ethernet driver mentioned above.
           |                 \-09.0
           +-10.1
           +-14.0
           +-18.0
           +-18.1
           +-18.2
           \-18.3


‘lsusb’ Output

The lsusb command is similar to the lspci, but is meant for the USB bus.

1
2
3
4
5
6
7
8
9
10
11
# lsusb
Bus 002 Device 003: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Bus 002 Device 002: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 038: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 008: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 007: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 005: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The same set of commands holds true for lsusb. There is quite verbose output when using the -v command.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Bus 002 Device 003: ID 046d:c016 Logitech, Inc. M-UV69a/HP M-UV96 Optical Wheel Mouse
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc016 M-UV69a/HP M-UV96 Optical Wheel Mouse
  bcdDevice            3.40
  iManufacturer           1 Logitech
  iProduct                2 Optical USB Mouse
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              10
Device Status:     0x0000
  (Bus Powered)

Quite a lot of information. Some useful and some not. The vendor and product information is probably the most useful. We can also output the USB bus tree as well.

1
2
3
4
5
6
7
8
9
10
11
# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/8p, 12M
    |__ Port 1: Dev 2, If 0, Class=HID, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 0, Class=HID, Driver=usbhid, 1.5M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M
    |__ Port 4: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 6, If 0, Class=vend., Driver=ftdi_sio, 12M
        |__ Port 4: Dev 7, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 8, If 0, Class=vend., Driver=ftdi_sio, 12M
            |__ Port 2: Dev 38, If 0, Class=vend., Driver=ftdi_sio, 12M
    |__ Port 8: Dev 5, If 0, Class=stor., Driver=usb-storage, 480M

Its output is more appetizing than the bus tree output from lspci, and even includes the kernel drivers used for each bus port.

Well there you have it, a quick outline of the two commands. Now that you can identify your devices, this may be handy to flip back to Windows to grab the correct drivers if Windows is having problems identifying hardware.