How to get hardware information in Linux?

02/06/2010 at 20:01 Leave a comment

This guide requires use of the Terminal, and can be used on all Linux systems (as far as I know).

The package were going to use is named Hardware Lister (command: lshw).

Most Linux systems and distros comes with this pre-installed as default, but if you should need to install it you just write this in your Terminal:

APT (Debian, Ubuntu…): sudo apt-get install lshw

Yum (Fedora, Red Hat…): sudo yum install lshw

If your system doesn’t use APT or Yum (and doesn’t have lshw pre-installed), you can visit this site for installation instructions: Hardware Lister (lshw).

But as I said most systems comes pre-installed with this package as default, so you doesn’t have to use the commands mentioned over unless this command doesn’t work:

sudo lshw

If you got lot’s of text about your system you have it installed. Yey! But if you get the message bash: lshw: command not found you will have to install it.

This single command gives you all the information you will need about your hardware. But what if you just want some part of this information? No problem, just use these commands:

  • Short summary of all the important information: sudo lshw -short
  • Information about your system (like manufacturer, serial-number, type etc. ) : sudo lshw -class system
  • For memory (RAM, BIOS, firmware etc. ) information type:
    sudo lshw -class memory
  • CPU info: sudo lshw -class cpu
  • Information about your disk(s) sudo lshw -class disk
  • Network information: sudo lshw -class network
  • Disk volum information sudo lshw -class volume
  • Example of how you can combine these commands: sudo lshw -class system -class memory -class cpu

Like you maybe has understood by now, the information in ishw is stored in classes (therefore the -class). So this is just some examples, and if you want the whole list of classes you can visit Hardware Lister’s homepage (or just use sudo lshw and try to memorise the classes by yourself)

But what if you want to store this information in a file, so you dosn’t have to do the lshw information everytime your wondering about some of your hardware info? That’s no problem either :)

  • Store the information as a .txt file: sudo lshw > hardware-info.txt
  • Store it as a HTML file: sudo lshw -html > hardware-info.html
  • And finally as a XML file: sudo lshw -xml > hardware-info.xml

Note that all these commands will save the files in your home folder, and that the commands of course can be combined with the ones mentioned over for you specific needs (but if your not really into using the terminal yet I would stay with the ones I have mentioned here for now).

If your kind of scared of using the Terminal there’s a option for you too: Just go to Synaptic and do a little search for lshw-gtk (gtk-lshw in some distributions) and install it. You can also install it by typing this command in the Terminal sudo apt-get install lshw-gtk (ATP).


Entry filed under: Hardware, Linux Mint, Other, Terminal, Tutorials, Ubuntu. Tags: , , , , , , .

Check-list after installing Ubuntu 10.04 – Lucid Lynx When Linux Hangs or Completely Freezes

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

Licensed Under:

Creative Commons LicenseExcept where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Tux and GNU are published under the GNU General Public License.



%d bloggers like this: