Tools to find Computer hardware specification in Linux
Many times we are in need of knowing detailed Computer hardware configuration for various purposes such as to get right driver, debugging, to prepare system information report, etc. In linux many such tools are available in command line. Here I am trying to list down three tools which I know. They are hwinfo, lshw and dmidecode. I believe both lshw and dmidecode are installed by default Ubuntu installation. If not follow the instructions below to get it installed. Now let’s see one by one.
My laptop is Sony VAIO VGN-CS15GN/B with Intel Core 2 Duo Processor P8400 (2.26GHz), Memory 2GB and Hard disk drive 250GB. I have installed Ubuntu 10.04 on it.
1. hwinfo – Probe for hardware tool
The man page says “hwinfo is used to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support. This is the best tool in my opinion – it gives more information about your system hardware specification than any other tools and also the report is well organized and easily accessible through command line switches”.
$ sudo apt-get install hwinfo
$ sudo hwinfo
The above command will fetch complete report about all hardware components, model number, serial number, vendor, device class, descriptions, features, etc.
If you don’t want full report, you can get information about a particular class of hardware such as BIOS, Processor, memory, hard disks, printer, scanner, etc. The below command will fetch information of your computer’s RAM (memory is the hardware item in this example. To know all hardware item supported by this tool check with man page of hwinfo).
$ sudo hwinfo –memory[sudo] password for blackgod:01: None 00.0: 10102 Main Memory[Created at memory.61]Unique ID: rdCR.CxwsZFjVASFHardware Class: memoryModel: “Main Memory”Memory Range: 0x00000000-0x754fffff (rw)Memory Size: 1 GB + 896 MBConfig Status: cfg=new, avail=yes, need=no, active=unknown
Similarly the below command will fetch the amazing amount of information about wireless LAN component of your system.
$ sudo hwinfo –wlan
[sudo] password for blackgod:
20: PCI 300.0: 0282 WLAN controller
[Created at pci.318]
Unique ID: y9sn.4sCLS2kIqkC
Parent ID: hoOk.ABTEjCxdYN4
SysFS ID: /devices/pci0000:00/0000:00:1c.2/0000:03:00.0
SysFS BusID: 0000:03:00.0
Hardware Class: network
Model: “Intel Wireless WiFi Link 5100″
Vendor: pci 0x8086 “Intel Corporation”
Device: pci 0x4232 “Wireless WiFi Link 5100″
SubVendor: pci 0x8086 “Intel Corporation”
SubDevice: pci 0x1301
Driver Modules: “iwlagn”
Device File: wlan0
Memory Range: 0x94600000-0x94601fff (rw,non-prefetchable)
IRQ: 30 (no events)
HW Address: xx:xx:xx:xx:xx:xx (Edited for security)
Link detected: yes
WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 36 … 149 153
WLAN frequencies: 2.412 2.417 2.422 … 5.745 5.765
WLAN encryption modes: WEP40 WEP104 TKIP CCMP
WLAN authentication modes: open sharedkey wpa-psk wpa-eap
Module Alias: “pci:v00008086d00004232sv00008086sd00001301bc02sc80i00″
Driver Info #0:
Driver Status: iwlagn is active
Driver Activation Cmd: “modprobe iwlagn”
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #9 (PCI bridge)
2. lshw – list hardware
The man page says “lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work)”.
$ sudo apt-get install lshw
If you want GUI tool, install lshw-gtk also (courtesy: Reddit)
$ sudo apt-get install lshw-gtk
The below command will list down the supported hardware class. This is necessary to get information about a specific class.
$ sudo lshw -short
The below example shows how to get storage controller hardware information.
$ sudo lshw -class storage
description: SATA controller
product: ICH9M/M-E SATA AHCI Controller
vendor: Intel Corporation
physical id: 1f.2
bus info: pci@0000:00:1f.2
logical name: scsi0
logical name: scsi1
width: 32 bits
capabilities: storage msi pm bus_master cap_list emulated
configuration: driver=ahci latency=0
resources: irq:28 ioport:60e8(size=8) … memory:96804000-968047ff
3. dmidecode – DMI table decoder
The man page says “dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision”.
$ sudo apt-get install dmidecode
The below command will list complete hardware information.
$ sudo dmidecode
A specified hardware class details can be retrieved using key words (listed on man page of dmidecode). The following example is about bios information.
$ sudo dmidecode -s bios-vendor
$ sudo dmidecode -s bios-version
EDIT: I had ended the list with these less used powerful tools, but I have added the following widely used tools also based on user comments to make the list complete.
4. Other famous tools and commands
The following tools are widely used by most of the users.
lspci – details about all PCI devices in the system.
lsusb – details about all USB devices in the system.
cat /proc/cpuinfo – details about processors
cat /proc/meminfo – details about main memory (RAM)
cat /proc/interrupts – listing of interrupts of all devices
cat /proc/partitions – listing all disk partitions
Look at /proc directory for more useful files.
I believe the above tools will be useful to you. Please comment here on any other tool similar to the above list.