How to Gather Hardware Information in Linux

Can you name your motherboard’s chipset off the top of your head? What about NIC type? If not, how would you go about finding it? Could you do it from the command line? As with a lot of Linux software, there are many ways to go about this. Some tools are built right into any Linux system, others might require a separate download. Today we’re going to cover several of the ways to view your hardware details in Linux, including the pros and cons of each.

lspci

This standard system utility will show you much of what you’ve got internally. Yes, the name of the command is a combination of ls, the standard command to list files, and PCI, the peripheral connection. Despite that, it doesn’t show only PCI devices and you can expect your results to include AGP and onboard components like your USB chipset.

 

It’s often helpful to pipe the results of lspci through grep, so that you can filter out just the parts you’re looking for. Use lspci -v or lspci -vv for additional output.

Pros: Built in to virtually any Linux OS, quick and easy, thorough output.

Cons: Somewhat limited in the types of devices it can display.

hwinfo

While lspci does more than just PCI, it doesn’t tell you anything about your hard disks, CPU, USB devices, etc. If lspci can’t handle it, hwinfo probably can. This application performs a much more thorough scan to determine what bits you’ve got connected to your PC, and provides a LOT of info by default.

 

As seen in the screenshot, you can use --short to provide more concise output, and --devicetype to list a specific type of information.Some of the more useful device types include:

  • bluetooth
  • camera
  • cdrom
  • cpu
  • disk
  • gfxcard
  • ide
  • memory
  • monitor
  • netcard
  • partition
  • printer
  • scanner
  • scsi
  • sound
  • usb
  • wlan

Pros: Extensive output, very large device type support

Cons: Requires root privileges on many systems. Also not included in many base Linux installs. It should, however, be in the standard repositories of most major distributions.

lshw

This tool comes in two forms, a command line version and a GTK graphical front-end. Testing for this article showed it to be somewhat less comprehensive than hwinfo, but makes up for it with a useful GUI (lshw-gtk) and the ability to output the results to HTML/XML.

 

Pros: Graphical frontend, particularly useful output options.

Cons: Produces very little output without root access, and even with root it doesn’t match up to hwinfo in raw power.

/proc

We’ve covered the information treasure trove that is /proc previously, so we won’t go into much detail here. Suffice it to say that the “files” in /proc aren’t normal files, and most of them contain constantly-updating data about the state of the system. To get information about your CPU, for example, you can just view the contents of /proc/cpuinfo, as shown here.

 

Pros: Found on virtually all Linux systems, requires no external applications whatsoever

Cons: No easy way to perform a all-in-one scan, and may not contain all the info you wish.

Bonus – dmesg

While not exactly a hardware probing tool, you can you dmesg to find out some info about hardware events. All it does is display the contents of the system log, which saves info about various system events. For example, if you’ve got a USB thumbdrive you just plugged in, your system saves some info about it to the log. dmesg displays that log and can show you, among other things, the name of the device.

Conclusion

Each method described here has its own advantages, but hwinfo seems to take the crown for most comprehensive. In particular, hwinfo’s ability to quickly and easy show connected drives and partitions stands out as useful to me. Whichever method or combination of methods you choose, you should be ready to find all the info your system can provide.

 

SOURCE – MAKE TECH EASIER

The following two tabs change content below.
Wale Falade is Nigerian. A Business Systems Analyst, Technology Enthusiast and a Linux Server Administrator. He engages actively in improving online visibility of Nigerian brands. Follow him on twitter @diaryofageek