The lspci
command is a Linux utility that displays detailed information about all the PCI buses and devices connected to them in the current host computer. This information includes device names, vendor names, device IDs, and other technical details. This command is useful for system administrators and users who need to troubleshoot hardware issues, identify devices, and check hardware compatibility.
Overview
To use the lspci
command, open a terminal and type lspci
followed by any options you want to use. The output will be a list of all the PCI devices connected to the system. Here is an example:
$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
...
The output shows the device’s bus number, device number, function number, vendor name, device name, and other technical details.
You can also use the lspci
command with specific options to filter and sort the output. For example, to display only Ethernet devices, use the -k
option with the keyword Ethernet
:
$ lspci -k | grep Ethernet
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V
To display the output in a more human-readable format, use the -v
option:
$ lspci -v
...
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06) (prog-if 00 [VGA controller])
Subsystem: Dell HD Graphics 530
Flags: bus master, fast devsel, latency 0, IRQ 131
Memory at d0000000 (64-bit, non-prefetchable) [size=16M]
Memory at c0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
Expansion ROM at <ignored>
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915
...
Options
The lspci
command has several options that you can use to customize the output. Here is a table of the most commonly used options:
Option | Description |
---|---|
-b |
Show bus numbers in decimal format |
-D |
Show all devices, including those that are not claimed by a driver |
-d <vendor:device> |
Show only devices from the specified vendor and device |
-e <filename> |
Use the specified file to decode PCI IDs |
-k |
Show kernel driver in use for each device |
-s <slot> |
Show only the device in the specified slot |
-v |
Show verbose output |
-x |
Show hex-dump of the PCI configuration space for each device |
Troubleshooting tips
If the lspci
command does not display any output, it may indicate a problem with the PCI bus or the command itself. Here are some troubleshooting tips:
- Make sure the PCI bus is properly connected and powered on.
- Check that the
lspci
command is installed on the system. - Run the command with elevated privileges (
sudo lspci
) if necessary. - Try using different options to filter the output and narrow down the problem.
Notes
- The
lspci
command requires root privileges to display some information, such as the kernel driver in use. - The output of the
lspci
command can be very long and detailed, so it may be useful to pipe the output to a file or another command for further analysis.