Linux "lspci" Command Line Options and Examples
list all PCI devices

lspci is a utility for displaying information about PCI buses in the system and devices connected to them. By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by other programs.


Usage:

lspci [options]






Command Line Options:

-m
Dump PCI device data in a backward-compatible machine readable form. See below for details.
lspci -m ...
-mm
Dump PCI device data in a machine readable form for easy parsing by scripts. See below for details.
lspci -mm ...
-v
Be verbose and display detailed information about all devices.
lspci -v ...
-vv
Be very verbose and display more details. This level includes everything deemed useful.
lspci -vv ...
-x
Show hexadecimal dump of the standard part of the configuration space (the first 64 bytes or 128 bytes for CardBus bridges).
lspci -x ...
-xxxx
Show hexadecimal dump of the extended (4096-byte) PCI configuration space available on PCI-X 2.0 and PCI Express buses.
lspci -xxxx ...
-b
Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the PCI bus instead of as seen by the kernel.
lspci -b ...
-n
Show PCI vendor and device codes as numbers instead of looking them up in the PCI ID list.
lspci -n ...
-nn
Show PCI vendor and device codes as both numbers and names.
lspci -nn ...
-qq
but the local cache is reset.
lspci -qq ...
-s
Show only devices in the specified domain (in case your machine has several host bridges, they can either share a common busnumber space or each of them can address a PCI domain of its own; domains are numbered from 0 to ffff), bus (0 to ff), device(0 to 1f) and function (0 to 7). Each component of the device address can be omitted or set to "*", both meaning "any value".All numbers are hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0 on any bus, "0.3"selects third function of device 0 on all buses and ".4" shows only the fourth function of each device.
lspci -s ...
-d
Show only devices with specified vendor, device and class ID. The ID's are given in hexadecimal and may be omitted or given as"*", both meaning "any value".Other options
lspci -d ...
-i
Use <file> as the PCI ID list instead of /usr/share/misc/pci.ids.
lspci -i ...
-p
Use <file> as the map of PCI ID's handled by kernel modules. By default, lspci uses /lib/modules/kernel_version/mod‐ules.pcimap. Applies only to Linux systems with recent enough module tools.
lspci -p ...
--version
Shows lspci version. This option should be used stand-alone.PCI access optionsThe PCI utilities use the PCI library to talk to PCI devices (see pcilib(7) for details). You can use the following options to influ‐ence its behavior:
lspci --version ...
-A
The library supports a variety of methods to access the PCI hardware. By default, it uses the first access method available,but you can use this option to override this decision. See -A help for a list of available methods and their descriptions.
lspci -A ...
-O
The behavior of the library is controlled by several named parameters. This option allows to set the value of any of theparameters. Use -O help for a list of known parameters and their default values.
lspci -O ...
-H1
Use direct hardware access via Intel configuration mechanism 1. (This is a shorthand for -A intel-conf1.)
lspci -H1 ...
-H2
Use direct hardware access via Intel configuration mechanism 2. (This is a shorthand for -A intel-conf2.)
lspci -H2 ...
-F
Instead of accessing real hardware, read the list of devices and values of their configuration registers from the given fileproduced by an earlier run of lspci -x. This is very useful for analysis of user-supplied bug reports, because you can dis‐play the hardware configuration in any way you want without disturbing the user with requests for more dumps.
lspci -F ...
-G
MACHINE READABLE OUTPUTIf you intend to process the output of lspci automatically, please use one of the machine-readable output formats (-m, -vm, -vmm)described in this section. All other formats are likely to change between versions of lspci.All numbers are always printed in hexadecimal. If you want to process numeric ID's instead of names, please add the -n switch.Simple format (-m)In the simple format, each device is described on a single line, which is formatted as parameters suitable for passing to a shellscript, i.e., values separated by whitespaces, quoted and escaped if necessary. Some of the arguments are positional: slot, class,vendor name, device name, subsystem vendor name and subsystem name (the last two are empty if the device has no subsystem); theremaining arguments are option-like:
lspci -G ...
-rrev
Revision number.
lspci -rrev ...
-pprogif
Programming interface.The relative order of positional arguments and options is undefined. New options can be added in future versions, but they willalways have a single argument not separated from the option by any spaces, so they can be easily ignored if not recognized.Verbose format (-vmm)The verbose output is a sequence of records separated by blank lines. Each record describes a single device by a sequence of lines,each line containing a single `tag: value' pair. The tag and the value are separated by a single tab character. Neither the recordsnor the lines within a record are in any particular order. Tags are case-sensitive.The following tags are defined:Slot The name of the slot where the device resides ([domain:]bus:device.function). This tag is always the first in a record.Class Name of the class.Vendor Name of the vendor.Device Name of the device.SVendorName of the subsystem vendor (optional).SDeviceName of the subsystem (optional).PhySlotThe physical slot where the device resides (optional, Linux only).Rev Revision number (optional).ProgIf Programming interface (optional).Driver Kernel driver currently handling the device (optional, Linux only).Module Kernel module reporting that it is capable of handling the device (optional, Linux only).NUMANodeNUMA node this device is connected to (optional, Linux only).New tags can be added in future versions, so you should silently ignore any tags you don't recognize.Backward-compatible verbose format (-vm)In this mode, lspci tries to be perfectly compatible with its old versions. It's almost the same as the regular verbose format, butthe Device tag is used for both the slot and the device name, so it occurs twice in a single record. Please avoid using this formatin any new code.FILES/usr/share/misc/pci.idsA list of all known PCI ID's (vendors, devices, classes and subclasses). Maintained at http://pciids.sourceforge.net/, use theupdate-pciids utility to download the most recent version./usr/share/misc/pci.ids.gzIf lspci is compiled with support for compression, this file is tried before pci.ids.~/.pciids-cacheAll ID's found in the DNS query mode are cached in this file.BUGSSometimes, lspci is not able to decode the configuration registers completely. This usually happens when not enough documentationwas available to the authors. In such cases, it at least prints the <?> mark to signal that there is potentially something more tosay. If you know the details, patches will be of course welcome.Access to the extended configuration space is currently supported only by the linux_sysfs back-end.
lspci -pprogif ...