How To: List Hardware From The Terminal (lshw)

You may not always have inxi available. The person trying to help you may want more specific info. You may need more information about your hardware. Who knows? There’s all sorts of reasons to use ‘lshw’ in your day-to-day computing.

Today is another short and easy article (you’re welcome). It’s just a very brief command, one of several, that we’re going to learn how to use. The command in question is ‘lshw‘. The manual helpfully defines it as:

lshw – list hardware

Which, now that you look at it, makes perfectly good sense. This is one of those Linux commands that’s not at all cryptic when you think about it. It looks like what it does, it does what you’d intuitively think it does. (It’s actually a subset of the info you get with ‘hwinfo’, but that’s not important right now!)

What is important is that there are two realistic ways to use it – and both of them should be run as an administrator. The first is just as you’d expect:

That will output a ton of information about the hardware you have in (or connected to) your computer. It’s rather overwhelming and it’s not often that you’ll be asked to post all of it. You may be asked to (or want to) run it with the -C option, such as:

You may even be asked to use grep with it, such as:

Then, there’s one more way to run the program (under normal circumstances) and that’s to run the whole thing and to get the whole output in a shorter format. The command is probably just like you’d expect.

Lo and behold! Would you look at that! Ha! Isn’t that fantastic? You actually get readable output that’s suitable for your normal user who just wants to know what sorta hardware they’re working with while getting a few extra bits of info! It even includes juicy nuggets like:

Now, if you want to refine it even further, why not try this:

And, there you have it… You have another way to see your hardware in the terminal and it should be consistent across any major distro you touch. You shouldn’t have any trouble using the command and it’s easy to remember when you want to ‘list the hardware’. There are other uses, but those two are the most common. For more information about the lshw command try:


Like always, thanks for reading. Feel free to subscribe to the newsletter. I promise to not give away your private information – and you never know what sorta incentives I may stick in there. See? I told you this one would be short and easy!

Smash a Button
[Total: 0 Average: 0]
Get PDFPrint This
About Me: I'm just some retired dude with a little bit more free time on my hands. If you want to support the site, why not help yourself out too by ordering some inexpensive web hosting so that you can start your own site?

Author: Admin

I'm a retired mathematician that has a fondness for Linux and many (not all) things tech. I'm an old-school geek that just enjoys the life he has. I live in a very, very rural area of Maine.

2 thoughts on “How To: List Hardware From The Terminal (lshw)”

  1. the command i like so i can look at output later, in a nice html format so i can use browser is as root :
    lshw -html > /home/andrew/Desktop/mypc.html

    that puts all the output in a file called mypc.html on my Desktop

    1. Nice! You’re the only one I’ve ever met that uses the HTML output option. It’s good to know it’s used and that’s an excellent idea!

Leave a Reply

Your email address will not be published. Required fields are marked *

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.