下面是对Linux命令lspci的详细讲解。
lspci命令简介
lspci命令是Linux操作系统上的一个工具,用于列出当前计算机上的所有PCI总线设备的信息,例如磁盘控制器、声卡、网卡等等。有时候我们需要知道设备的硬件ID或者设备的型号,这时候就可以借助lspci命令来查询。
lspci命令可以用两种方式来显示PCI设备信息。
第一种方式是使用-v选项,可输出完整的信息,包括每个设备的制造商、设备名称、驱动程序以及其他相关信息。
第二种方式是使用-n选项,该选项只输出设备的硬件ID信息。
lspci命令语法
lspci命令的语法格式如下:
lspci [-tvmm][-f]<过滤器>
lspci命令常用选项:
- -t:以树形的形式来显示设备信息;
- -v:显示详细的设备信息;
- -mm:以机器可读的格式来显示设备信息;
- -f:<过滤器>:显示指定设备的详细信息;
- -n:只显示设备的硬件ID信息。
lspci命令实例
以树形形式列出所有设备的信息:
sudo lspci -t
输出结果:
-[0000:00]-+-00.0 Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
+-01.0-[01]--+-00.0 NVIDIA Corporation GK208 [GeForce GT 730]
| \-00.1 NVIDIA Corporation GK208 HDMI/DP Audio Controller
+-02.0 Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
+-14.0 Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller
+-16.0 Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1
+-1a.0 Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2
......
以详细形式列出设备信息:
sudo lspci -v
输出结果:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
Subsystem: ASRock Incorporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller
Flags: bus master, fast devsel, latency 0
Capabilities: <access denied>
Kernel driver in use: ivb_uncore
00:01.0 VGA compatible controller: NVIDIA Corporation GK208 [GeForce GT 730] (rev a1) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. GK208 [GeForce GT 730]
Flags: bus master, fast devsel, latency 0, IRQ 31
Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=128M]
Memory at e0000000 (64-bit, prefetchable) [size=32M]
I/O ports at e000 [size=128]
Expansion ROM at fb000000 [disabled] [size=512K]
Capabilities: <access denied>
Kernel driver in use: nouveau
Kernel modules: nvidiafb, nouveau
00:01.1 Audio device: NVIDIA Corporation GK208 HDMI/DP Audio Controller (rev a1)
Subsystem: ASUSTeK Computer Inc. GK208 HDMI/DP Audio Controller
Flags: bus master, fast devsel, latency 0, IRQ 32
Memory at fb080000 (32-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: snd_hda_intel
Kernel modules: snd_hda_intel
00:02.0 Display controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)
Subsystem: ASRock Incorporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
Flags: bus master, fast devsel, latency 0, IRQ 32
Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
Expansion ROM at <unassigned> [disabled]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915
......
这就是lspci命令的详细攻略。
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:详解Linux lspci命令:显示 PCI 设备信息 - Python技术站