我怎样才能从列表中 grep 某些内容

我怎样才能从列表中 grep 某些内容

我如何 grep、sed、cut、xargs 或 awk lspci 的输出

我希望获得延迟时间、设备名称和左侧的数字,无论它是什么

我试过了

lspci -vv | egrep latency | awk '{print $6,$7}'

但它显示了我不感兴趣的其他信息

 00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
 Subsystem: Dell SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
 Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 18, NUMA node 0
 Memory at feb05000 (32-bit, non-prefetchable) [size=4K]
 Kernel driver in use: ohci-pci
 Kernel modules: ohci_pci


 00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
 Subsystem: Dell SB7x0/SB8x0/SB9x0 USB EHCI Controller
 Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 17, NUMA node 0
 Memory at feb04000 (32-bit, non-prefetchable) [size=256]
 Capabilities: [c0] Power Management version 2
 Capabilities: [e4] Debug port: BAR=1 offset=00e0
 Kernel driver in use: ehci-pci
 Kernel modules: ehci_pci

答案1

这个怎么样?

lspci -vv  | grep -e ':'[0-9] -e "Latency"

相关内容