lspci command lists all Peripheral Component Interconnect (PCI) devices. This command has many options that are useful for debugging device drivers. If we just run lspci, we get a list of devices and their IDs:
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 interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) 00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter 00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02) 00:04.0 System peripheral: InnoTek Systemberatung GmbH VirtualBox Guest Service 00:05.0 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 01) 00:07.0 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
Understanding lspci Command Output
The field givin in the output of lspci are as follows:
0000:06:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
- 0000: PCI domain (each domain can contain up to 256 PCI buses)
- 06: the bus number the device is attached to
- 00: the device number
- .1: PCI device function
- Ethernet controller: device class
- Intel Corporation: vendor ID
- I350 Gigabit Network Connection (rev 01): device ID
The lspci command provides all the relevant information concerning the PCI devices of your server, which in turn, can be expanded by employing either the -v option or the alternative -vv / -vvv option(s), depending on the level of detail you require:
# lspci -v # lspci -vv # lspci -vvv
If you encounter the below error while running the lspci command:
lspci: command not found
you may try installing the pciutils package as shown below as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install pciutils |
Ubuntu | apt-get install pciutils |
Alpine | apk add pciutils |
Arch Linux | pacman -S pciutils |
Kali Linux | apt-get install pciutils |
CentOS | yum install pciutils |
Fedora | dnf install pciutils |
Raspbian | apt-get install pciutils |
lspci Command Examples
1. To list all PCI devices:
# lspci
2. To Dump PCI device data in a backward-compatible machine readable form:
# lspci -m
3. To Dump PCI device data in a machine readable form for easy parsing by scripts:
# lspci -mm
4. To Show a tree-like diagram containing all buses:
# lspci -t
5. To display in verbose mode:
# lspci -v
6. To be very verbose:
# lspci -vv
7. To be even more verbose:
# lspci -vvv
8. To Show kernel drivers handling each device and also kernel modules capable of handling it:
# lspci -k
9. To Show hexadecimal dump of the whole PCI configuration space:
# lspci -xxx
10. To Show hexadecimal dump of the extended (4096-byte) PCI configuration space available on:
# lspci -xxxx
11. For bus centric view:
# lspci -b
12. To always show PCI domain numbers:
# lspci -D
13. To show PCI vendor and device codes as numbers instead:
# lspci -n
14. To show PCI vendor and device codes as both numbers and names:
# lspci -nn
15. To use DNS to query the central PCI ID database if a device is not found in the local pci.ids file:
# lspci -q
16. To reset local cache:
# lspci -qq
17. To Query the central database even for entries which are recognized locally:
# lspci -Q
18. To Show only devices in the specified domain:
# lspci -s domain
19. To Show only devices with specified vendor and device ID:
# lspci -d vendor
20. To Use as the PCI ID list instead of /usr/share/hwdata/pci.ids:
# lspci -i /path/file
21. To Use as the map of PCI IDâs handled by kernel modules:
# lspci -p file
22. To Invoke bus mapping mode which performs a thorough scan of all PCI devices:
# lspci -M
23. To get the lspci version:
# lspci --version
24. To The library supports a variety of methods to access the PCI hardware:
# lspci -A method
25. To increase the debug level:
# lspci -G