Linux lshw Command

Here’s a short post about Linux’s lshw command. That’s LSHW as in LiSt HardWare. Pretty vital if you’re doing…well anything really.

sudo lshw
Lists all connected hardware. Outputs a lot of information. You’re probably only interested in a small part of the output, so you probably want to do something like this:

sudo lshw -class memory
…which lists all memory devices. You can shorten -class to -c if your fingers are tired. To find other classes to search for try doing this:

sudo lshw -short
…and looking at the class column.

If you are interested in the entire list of hardware, the easiest way to view it all is probably to save it to a file. Maybe as HTML.

sudo lshw -html > filename.html
That’ll do it. You can also use -xml if you’re like that. Tidy.

Alternatively you could use the less command which will let you scroll up and down the output within the terminal. Like so:

sudo lshw | less
Press q to get back to the prompt.

Note: According to the man page the -sanitize flag removes any potentially sensible [sic.] information from the output. Seems fairly sensitive to me.


About Mr Chimp

I make music, draw pictures, browse the internet, programme, and make sweet, sweet cups of tea until the early hours.
This entry was posted in Linux and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s