lspci
The lspci
command in Linux is used to display information about all PCI (Peripheral Component Interconnect) buses in the system and all devices connected to them. It is a powerful tool for diagnosing hardware issues and for obtaining detailed information about PCI devices.
Understanding lspci
lspci
The lspci
command provides details about PCI devices, which include network cards, sound cards, USB controllers, and other hardware connected to the PCI bus.
Basic Usage
To display a list of all PCI devices, simply run:
Example Output
Here’s an example of what the lspci
command might return:
Detailed Output
To get more detailed information about the PCI devices, use the -v
(verbose) option:
Example Detailed Output
Here’s an example of detailed output:
Key Options
-v: Verbose output. Displays detailed information about each device.
-vv: Very verbose output. Displays even more detailed information.
-k: Show kernel drivers handling each device.
-t: Show a tree view of the devices.
-nn: Show numeric IDs for devices.
-s [bus:device.function]: Show only devices in the specified slot.
-d [vendor:device]: Show only devices with the specified vendor and device ID.
Practical Examples
Display Information About a Specific Device:
This command will display information about the device located at bus 00, device 14, function 0.
Show Kernel Drivers Handling Devices:
This command will show which kernel drivers are being used for each device.
List All Devices with Vendor and Device IDs:
This command will display all devices with their numeric vendor and device IDs.
Show PCI Device Tree:
This command displays a tree view of the devices, showing the hierarchy and relationships between them.
Filter by Vendor and Device ID:
This command will list devices that match the specified vendor (8086) and device (1237) IDs.
Related Commands
lspci -vv: For very verbose output, which includes detailed information about each device's configuration space.
lspci -xxx: To display the raw hexadecimal dump of the PCI configuration space.
lspci -b: To display the IRQ numbers in decimal instead of hexadecimal.
lshw: Another command that provides detailed information about hardware.
Conclusion
The lspci
command is a vital tool for system administrators and users who need to gather detailed information about the PCI devices on their Linux systems. It is particularly useful for diagnosing hardware issues, verifying device drivers, and understanding the hardware configuration.
Last updated