Inspect hardware with lspci
In this step, we will use the lspci
command to list information about PCI devices connected to your system. PCI (Peripheral Component Interconnect) is a standard bus that connects hardware devices to the computer's motherboard. Many devices, including network cards, graphics cards, and storage controllers, are connected via PCI or its successor, PCI Express (PCIe).
The lspci
command is useful for quickly identifying connected hardware and their basic information.
Type the following command in your terminal and press Enter:
lspci
You will see a list of PCI devices. The output will look something like this:
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE controller: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:01.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Red Hat, Inc. QXL Paravirtual graphic driver
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:04.0 Communication controller: Red Hat, Inc. Virtio console
00:05.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
00:06.0 Unclassified device [0000]: Red Hat, Inc. Virtio balloon
00:07.0 Audio device: Intel Corporation 82801AA AC'97 Audio Controller (rev 01)
Each line represents a PCI device. The format is typically Bus:Device.Function Class: Vendor Product
.
Bus:Device.Function
: Identifies the location of the device on the PCI bus.
Class
: Describes the type of device (e.g., Host bridge, Ethernet controller, VGA compatible controller).
Vendor
and Product
: Identify the manufacturer and the specific model of the device.
Notice the line that says Ethernet controller: Red Hat, Inc. Virtio network device
. This corresponds to the network adapter we saw with lshw
and in /sys/class/net
. lspci
gives you a different perspective on the hardware, focusing on the PCI bus.
You can use lspci
with options like -v
for more verbose output or -nn
to show vendor and device IDs in a numerical format, which is useful for looking up hardware information online.
For example, try:
lspci -v
This will provide much more detailed information about each device. Press q
to exit the verbose output when you are done viewing it.
Click Continue to finish this lab.