Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

lspci

List the PCI devices (network cards, disk controllers, GPUs …) and the drivers that handle them.

Niveau
Dagelijks Linux
Groep
Kernel en hardware
Root nodig
Voor wijzigingen
Pakket
pciutils

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

lspci shows every device on the PCI bus with its vendor and model. -k adds the kernel driver in use and the modules that could drive it — the quick check that hardware works. -nn shows the numeric vendor:device IDs for searching drivers. Some details need root.

Zo schrijf je het

lspci [OPTION]...

Opties 22

Meest gebruikt

Display

-k
Show the kernel driver in use and possible modules.
-v, -vv, -vvv
More and more details.
-nn
Names and numeric IDs (vendor:device).
-n
Only numeric IDs.
-t
Tree view of buses and bridges.
-m, -mm
Machine-readable output.
-b
Bus-centric view (IRQs and addresses as the card sees them).
-D
Always show the PCI domain.
-P, -PP
Show the path through bridges.
-x, -xxx, -xxxx
Hex dump of the config space (root for the full dump).
-q, -qq, -Q
Ask the online PCI ID database for unknown devices.

Select

-s [[[[DOMAIN]:]BUS]:][DEV][.[FUNC]]
Only this slot, like -s 00:03.0.
-d [VENDOR]:[DEVICE][:CLASS]
Only this vendor/device/class, like -d 8086:.

Data sources

-i FILE
Use this pci.ids file.
-p FILE
Use this modules.pcimap file.
-M
Bus mapping mode (full scan).
-A METHOD
Access method.
-O PARAM=VALUE
Library parameters.
-H1, -H2
Direct hardware access (old).
-F FILE
Read a hex dump from a file.
-G
Library debug.
--version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1All PCI devices

    lspci
    00:01.0 VGA compatible controller: Red Hat, Inc. Virtio 1.0 GPU (rev 01)
    01:00.0 Ethernet controller: Red Hat, Inc. Virtio 1.0 network device (rev 01)

    Slot, class and model.

  2. 2Devices with their drivers

    lspci -k
    01:00.0 Ethernet controller: Red Hat, Inc. Virtio 1.0 network device (rev 01)
    	Kernel driver in use: virtio-pci

    No "driver in use" = no driver loaded.

  3. 3Network cards only

    lspci | grep -i ethernet

    Then lspci -k -s SLOT.

  4. 4IDs for driver search

    lspci -nn | grep -i net
    01:00.0 Ethernet controller [0200]: Red Hat, Inc. Virtio 1.0 network device [1af4:1041] (rev 01)

    1af4:1041 = vendor:device.

  5. 5One device in detail

    lspci -vv -s 01:00.0

    Capabilities, link speed, IRQ.

  6. 6Tree view

    lspci -t

    Which device sits behind which bridge.

  7. 7Only Intel devices

    lspci -d 8086:

    Filter by vendor ID.

  8. 8Check the PCIe link speed of an NVMe disk

    lspci -vv -s 03:00.0 | grep -E 'LnkCap|LnkSta'

    A slower LnkSta than LnkCap = wrong slot or bad link.

  9. 9Update the ID database

    update-pciids

    Newer names for new hardware (needs internet).

  10. 10Hardware inventory for audits

    lspci -mm > /tmp/pci-$(hostname -s).txt

    Machine-readable list per host.

Bestanden

/usr/share/hwdata/pci.ids
Names of vendors and devices.

Exitcodes

0 :: Done. 1 :: Error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man 8 lspci