lspci
Overview
The lspci
command lists all PCI buses and devices connected to them. It provides detailed information about hardware devices in the system.
Syntax
lspci [options]
Common Options
Option | Description |
---|---|
-v |
Verbose mode |
-vv |
Very verbose mode |
-k |
Show kernel drivers |
-n |
Show PCI vendor/device codes |
-mm |
Machine readable format |
-t |
Show bus tree |
-s [[[[<domain>]:]<bus>]:][<device>][.[<func>]] |
Show specific device |
-d [<vendor>]:[<device>] |
Show specific vendor/device |
-i <file> |
Use specified ID database |
-D |
Show domain numbers |
Key Use Cases
- Hardware identification
- Driver troubleshooting
- System inventory
- Hardware verification
- Device monitoring
Examples with Explanations
Example 1: Basic List
lspci
Show basic device list
Example 2: Verbose Info
lspci -v
Show detailed device information
Example 3: Kernel Drivers
lspci -k
Show kernel modules for devices
Understanding Output
Format:
Bus:Device.Function Class: Vendor Device Description
Example:
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620
Common Usage Patterns
Check graphics card:
lspci | grep -i vga
Network interfaces:
lspci | grep -i ethernet
Show device tree:
lspci -t
Performance Analysis
- Fast execution
- System bus scanning
- PCI configuration space access
- Database lookup time
- Memory efficient
Additional Resources
Hardware Categories
- Graphics cards
- Network interfaces
- Storage controllers
- USB controllers
- Audio devices
Best Practices
- Regular hardware checks
- Driver verification
- Update PCI database
- Document changes
- Monitor performance