0

How can i grep, sed, cut, xargs or awk the output of lspci

I'm looking to get the latency time, the name of the device and the number on the left, whatever that is

I've tried

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

but It show other Information with It that I'm not Interested in

 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

How about this?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy