Linux lspci Command
What Is the lspci Command
lspci is a utility command in Linux used to list information about all PCI devices. PCI (Peripheral Component Interconnect) is a computer bus standard used to connect the motherboard to various hardware devices.
Pass lspci With the command, system administrators and developers can:
- View all PCI devices installed in the system
- Obtain detailed device information, including vendor ID, device ID, and more
- Diagnose hardware compatibility issues
- Check whether drivers are loaded correctly
Basic Syntax
lspci The basic syntax of the command is as follows:
lspci [选项]
If run without any options,lspci it displays a brief list of all PCI devices in the system.
Commonly used options
Display detailed information
Example
lspci
-v
Display detailed information (verbose)
lspci
-vv
Display more detailed information (very verbose)
lspci
-vvv
Display the most detailed information (very very verbose)
Query Specific Devices
Example
lspci
-s
<
Bus
:
<
Device
.
<
Function
View information for a specific device
For example:
Example
lspci
-s
00:
02.0
View the device on bus 00, device 02, function 0
Other common options
Example
lspci
-n
Display vendor and device IDs in numeric form
lspci
-nn
Display both numeric IDs and device names
lspci
-k
Display kernel driver module information
lspci
-t
Display the device hierarchy as a tree
lspci
-mm
Machine-readable format output
lspci
-D
Display the full domain name (including the domain number)
Interpreting the Output
A typical lspci The output is as follows:
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0f.0 VGA compatible controller: VMware SVGA II Adapter
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
00:11.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
00:12.0 Multimedia audio controller: Ensoniq ES1371/ES1373 / Creative Labs CT2518 (rev 02)
Output format description:
- Part one:
00:00.0is the device address, in the format总线:设备.功能 - Part two: Device type, such as "Host bridge" or "VGA compatible controller"
- The third part: Device vendor and specific model
Practical Application Examples
Example 1: View Basic Information for All PCI Devices
Example
lspci
Example 2: View Graphics Card Details
Example
lspci
-v
|
grep
-i
vga
-A
12
Example 3: View USB Controller and Driver Information
Example
lspci
-v
-k
|
grep
-i
usb
-A
3
Example 4: Display PCI Devices in a Tree Structure
Example
lspci
-t
Example output:
-[0000:00]-+-00.0
+-01.0
+-07.0
+-07.1
+-07.2
+-07.3
+-0f.0
+-10.0
+-11.0
\-12.0
Common Problem Solutions
1. Command Not Found
If the system reports lspci: command not found, it means you need to install pciutils the package:
Example
Debian/Ubuntu
sudo
apt-get install
pciutils
CentOS/RHEL
sudo
yum install
pciutils
2. Insufficient Permissions
When a regular user runs lspci the command, it may not return complete information; you can use sudo:
Example
sudo
lspci
-v
3. Device Recognition Issues
If certain devices cannot be recognized, try updating the PCI ID database:
Example
sudo
update-pciids
Advanced Tips
1. Filter Specific Devices with grep
Example
lspci
|
grep
-i
ethernet
Find network cards
lspci
|
grep
-i
audio
Find sound cards
2. Export Device Information to a File
Example
lspci
-vvv
pci_info.txt
3. View a Device's Full Configuration Space
Example
lspci
-xxxx
Display the configuration space in hexadecimal
Summary
lspci is an important tool for diagnosing and viewing PCI device information under Linux. Through this article, you should be able to:
- Understand
lspciMaster the basic usage and common options of the command - Interpretation
lspciUnderstand the output information of the command - Use
lspciResolve common hardware recognition issues - Master some advanced usage techniques
For system administrators and developers, skillful use of lspci the command can help quickly pinpoint hardware-related issues and is one of the important skills for Linux system maintenance.
Linux Command Reference