I want to see a tree-like structure of all devices in Linux. In Windows, I can use Device Manager with "show by connection". BSD systems report such data to dmesg in format "child at parent" and have utilities such as devinfo, so it is easy to understand relations between devices.

In Linux this information is stored in /sys, but its format is not user friendly.

I can query each bus with lspci, lsusb, lsscsi etc, but is there something I can use to recreate full device hierarchy? lshw shows bus information but not devices.

  • 1
    How about lshw ?
    – Atul
    Feb 21, 2019 at 23:08
  • 1
    Thanks @Atul . It looks good, but it seems that it shows only buses, it least for my installation. I see PCI host, I see USB and SATA controllers on it, but it does not show usb devices nor sda on my SATA..
    – user996142
    Feb 21, 2019 at 23:25
  • 1
    how about lsblk?
    – Michael D.
    Feb 21, 2019 at 23:30
  • How about a small script for showing the rest using lspci and lsblk
    – Atul
    Feb 21, 2019 at 23:30
  • I can combine lshw, lspci, lsusb, lsscsi and lsblk, but I wonder if there are some ready-to-use tools :)
    – user996142
    Feb 21, 2019 at 23:39

1 Answer 1


lshw-based utilities will provide you with such output. For complete output execute it as root.

Most likely you'll want gtk-lshw. On my system it looks like this:


Here you can see various entities (such as USB controller, PCI bridge) are written in bold and have a mark, meaning they contain sub-entities that you can descend into with double-click.

You can also execute sudo lshw -html > /tmp/devices.html and then open the html file in a browser, though currently (as of version B.02.18) it's inconveniently designed.

Note: there's a small bug in that L1, L2, L3 caches are shown as if they belong to the motherboard, whereas they are actually a part of CPU. Other than that, the tree looks valid.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .