lspci

2024-10-02

What is lspci?

lspci (List PCI) is a command-line utility that lists all PCI (Peripheral Component Interconnect) devices installed on your system. PCI is a standard interface used to connect various hardware components to the motherboard, including graphics cards, network adapters, sound cards, and more. lspci provides detailed information about each device, making it useful for system administrators and hardware enthusiasts alike.

Basic Usage

The simplest way to use lspci is to run it without any arguments:

lspci

This command will output a list of all PCI devices, each with a short description. The output typically includes the device’s vendor, device ID, class, and other identifying information. For example:

00:00.0 Host bridge: Intel Corporation 6 Series/C200 Series Chipset Family Host Bridge/DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev 09)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 03)
00:14.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 10 (rev 09)
00:1d.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 11 (rev 09)
...and so on

Advanced Usage and Options

lspci offers many options to refine its output and extract specific information:

lspci -v
lspci -nn
lspci -v -s 00:02.0
lspci -k
lspci -m "Network controller"
lspci -x

Combining Options for Powerful Analysis

You can combine multiple options for even more precise information gathering. For instance, to get verbose output for a specific device in XML format:

lspci -v -x -s 00:02.0

This command provides detailed information about the device at address 00:02.0 in a structured XML format, which is very useful for automated processing. Experiment with these options to tailor the output to your specific needs. Remember to consult the lspci --help output for a detailed list of available options.