2024-10-02
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.
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
lspci
offers many options to refine its output and extract specific information:
-v
(verbose): This option provides a much more detailed description of each device, including vendor and device specific information, resources used, and interrupt assignments.lspci -v
-nn
(no names): This option outputs the information in a more compact format without the vendor and device names. This is useful for scripting and parsing.lspci -nn
-s <address>
: This option allows you to specify a particular PCI address to get detailed information about a single device. The address is usually found in the basic lspci
output. For example, to get detailed information about the graphics card at address 00:02.0
:lspci -v -s 00:02.0
-k
(kernel modules): This option displays which kernel modules are associated with each PCI device. This can be helpful in diagnosing driver issues.lspci -k
-m
(match): This option allows you to search for devices matching a specific keyword. For example to list only network devices:lspci -m "Network controller"
-x
(XML output): Generates the output in an XML format, convenient for parsing with scripts.lspci -x
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.