Wednesday, September 02, 2009

What's inside your computer? Find out with Ubuntu

Ever wonder what, exactly, is inside your computer? The specific network card? The type of host controller?

Finding out isn't always just curiosity; getting the details of your computers innards can help you get the right drivers and tweak the hardware for peak performance.

In Ubuntu (or any flavor of Linux), there's an easy way to get the scoop. It's a terminal command called lshw or a graphical program called lshw-gtk.

If you don't have them installed, you can them quickly with Synaptic, or with the terminal commands:
sudo apt-get install lshw
sudo apt-get install lshw-gtk
Once you've installed them, you can open either from the terminal:
sudo lshw
gksudo lshw-gtk
Use sudo (or gksudo) because you need root privileges to get all of the information.

For a quick look, the command-line version is a little easier. The lshw commans gives you the full story, every device, model and setup.

If you'd prefer a summary, use:
sudo lshw -short
It's a little easier to digest. There are some other options at the end of the post.

The graphical program is nice, but it takes a little getting used to. When you first run it, it will open with just one description. In my case, it said "Notebook" in the left column and had a brief (really brief) description in the right-most column.

To get more information, look for little arrows and words in boldface. Double clicking on them opens up more details. When the words are in regular type, you've hit the last level of detail. Just click on the words to get the full description.

I copied the output of lshw into Tomboy and created a little wiki with all of the hardware information. Now when I need some details, I can just click through the notes.

With the command-line version, you can tailor the output to fit your needs.

Command-line Options

If you're using the command line, you can alter the format and the information you'll get with flags:
sudo lshw [-format] [-options]
For instance, if you want to get the information in html, you would use:
sudo lshw -html
If you want the generic information about the kind of hardware you have, without any identification numbers that are specific to your hardware, you would use:
sudo lshw - sanitize
For the generic information in html format, you would combine the flags:
sudo lshw -html -sanitize
Here are a few more formatting options:
  • -xml output hardware tree as XML
  • -businfo output bus information

And some more options:
  • -class CLASS only show a certain class of hardware
  • -C CLASS same as '-class CLASS'
  • -c CLASS same as '-class CLASS'
  • -disable TEST disable a test (like pci, isapnp, cpuid, etc. )
  • -enable TEST enable a test (like pci, isapnp, cpuid, etc. )
  • -quiet don't display status
  • -sanitize sanitize output (remove sensitive information like serial numbers, etc.)
  • -numeric output numeric IDs (for PCI, USB, etc.)
You can save the information as a file by using:
sudo lshw > [file name].txt
for example:
sudo lshw > my_hardware.txt
Reblog this post [with Zemanta]

No comments: