YouTip LogoYouTip

Linux Comm Lspci

[![Image 1: Linux Command Encyclopaedia](#) Linux Command Encyclopaedia](#)\n\n* * *\n\n## What is the lspci Command\n\n`lspci` is a utility command in Linux systems used to list information about all PCI devices. PCI (Peripheral Component Interconnect) is a computer bus standard used to connect the motherboard and various hardware devices.\n\nThrough the `lspci` command, system administrators and developers can:\n\n* View all PCI devices installed in the system\n* Obtain detailed device information, including vendor ID, device ID, etc.\n* Diagnose hardware compatibility issues\n* Check whether drivers are loaded correctly\n\n* * *\n\n## Basic Syntax\n\nThe basic syntax of the `lspci` command is as follows:\n\n```bash\nlspci \n\nIf no options are provided, `lspci` will display a brief list of information for all PCI devices in the system.\n\n* * *\n\n## Common Option Parameters\n\n### Display Detailed Information\n\n## Example\n\n```bash\nlspci -v # Display detailed information (verbose)\n\n```bash\nlspci -vv # Display even more detailed information (very verbose)\n\n```bash\nlspci -vvv # Display the most detailed information (very very verbose)\n\n### Query Specific Devices\n\n## Example\n\n```bash\nlspci -s :. # View information for a specific device\n\nFor example:\n\n## Example\n\n```bash\nlspci -s 00:02.0 # View the device on bus 00, device 02, function 0\n\n### Other Common Options\n\n## Example\n\n```bash\nlspci -n # Display vendor and device IDs in numeric form\n\n```bash\nlspci -nn # Display both numeric IDs and device names\n\n```bash\nlspci -k # Display kernel driver module information\n\n```bash\nlspci -t # Display device hierarchy in a tree structure\n\n```bash\nlspci -mm # Output in machine-readable format\n\n```bash\nlspci -D # Display full domain name (including domain number)\n\n* * *\n\n## Interpretation of Output\n\nA typical `lspci` output looks like this:\n\n00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)\n00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)\n00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)\n00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)\n00:07.2 USB controller: Intel Corporation 82371AB/EB/MB PIIX4 USB (rev 01)\n00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)\n00:0f.0 VGA compatible controller: VMware SVGA II Adapter\n00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)\n00:11.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)\n00:12.0 Multimedia audio controller: Ensoniq ES1371/ES1373 / Creative Labs CT2518 (rev 02)\n\nOutput Format Explanation:\n\n* **First Part**: `00:00.0` is the device address, formatted as `bus:device.function`\n* **Second Part**: Device type, such as "Host bridge," "VGA compatible controller," etc.\n* **Third Part**: Device vendor and specific model\n\n* * *\n\n## Practical Application Examples\n\n### Example 1: View Basic Information of All PCI Devices\n\n## Example\n\n```bash\nlspci\n\n### Example 2: View Detailed Information of the Graphics Card\n\n## Example\n\n```bash\nlspci -v | grep -i vga -A 12\n\n### Example 3: View USB Controller and Its Driver Information\n\n## Example\n\n```bash\nlspci -v -k | grep -i usb -A 3\n\n### Example 4: Display PCI Devices in a Tree Structure\n\n## Example\n\n```bash\nlspci -t\n\nOutput Example:\n\n-[0000:00]-+-00.0 +-01.0 +-07.0 +-07.1 +-07.2 +-07.3 +-0f.0 +-10.0 +-11.0 -12.0\n\n* * *\n\n## Troubleshooting Common Issues\n\n### 1. Command Not Found\n\nIf the system reports `lspci: command not found`, it means you need to install the `pciutils` package:\n\n## Example\n\n# Debian/Ubuntu\n\n```bash\nsudo apt-get install pciutils\n\n# CentOS/RHEL\n\n```bash\nsudo yum install pciutils\n\n### 2. Insufficient Permissions\n\nRegular users may not be able to obtain complete information when running `lspci`. Use `sudo`:\n\n## Example\n\n```bash\nsudo lspci -v\n\n### 3. Device Recognition Issues\n\nIf certain devices cannot be recognized, try updating the PCI ID database:\n\n## Example\n\n```bash\nsudo update-pciids\n\n* * *\n\n## Advanced Tips\n\n### 1. Filter Specific Devices Using grep\n\n## Example\n\n```bash\nlspci | grep -i ethernet # Find network cards\n\n```bash\nlspci | grep -i audio # Find sound cards\n\n### 2. Export Device Information to a File\n\n## Example\n\n```bash\nlspci -vvv > pci_info.txt\n\n### 3. View Complete Configuration Space of a Device\n\n## Example\n\n```bash\nlspci -xxxx # Display configuration space in hexadecimal\n\n* * *\n\n## Summary\n\n`lspci` is an important tool in Linux systems for diagnosing and viewing PCI device information. Through this article, you should now be able to:\n\n1. Understand the basic usage and common options of the `lspci` command\n2. Interpret the output of `lspci`\n3. Use `lspci` to solve common hardware recognition problems\n4. Master some advanced usage techniques\n\nFor system administrators and developers, being proficient with the `lspci` command can help quickly identify hardware-related issues, making it one of the essential skills for maintaining Linux systems.\n\n[![Image 2: Linux Command Encyclopaedia](#) Linux Command Encyclopaedia](#)
← Linux Comm UptimeLinux Comm Parted β†’