brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: lspci -t draws the PCI bus as a tree

Linux
~/tips/tip-hardware-lspci-t-tree

lspci -t

Shows buses, bridges and devices as a tree, so you see what hangs off what.

A flat lspci list tells you what is in the machine. It doesn’t tell you where it is plugged in. For that, ask for a tree.

lspci -t

The man page describes -t as a tree-like diagram containing all buses, bridges, devices and the connections between them. It helps when you wonder why a card shares a link with something else, or which bridge sits in front of a controller.

lspci -t -nn

-nn shows vendor and device codes as both numbers and names. To dig into one device after you spotted it in the tree, select it with -s and add -v:

lspci -s 0: -v

Per the man page, 0: means all devices on bus 0. A full address like the ones in the tree works too.

The caveat: in the tree the numbers are bus numbers, and the device lines are not as friendly as the plain list. Look at both side by side. And some details only show up when you run the command as root.

It also helps when you plan which slot to use for a new card. The tree shows what already shares a bridge with that slot.

Further reading: lspci man page

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link