is a Linux command which provides details of all the hardware in your PC. The details provided by the
lshw command run the gamut of processors, memory, slots, onboard sound, video chipset and more.
To install, just run:
$ sudo apt-get install lshw
To get the full details of your hardware, you need to run
lshw command as
root (or super user). If you are using Ubuntu or any of its derivatives, you can run it using
sudo as follows :
$ sudo lshw ubuntu description: Computer width: 32 bits *-core description: Motherboard physical id: 0 *-memory description: System memory physical id: 0 size: 875MiB *-cpu physical id: 1 bus info: cpu@0 *-network:0 description: Ethernet interface physical id: 1 logical name: usb0 serial: 00:11:22:33:44:55 capabilities: ethernet physical configuration: broadcast=yes driver=g_ether driverversion=29-May-2008 firmware=sw_usb_udc link=no multicast=yes *-network:1 description: Wireless interface physical id: 2 bus info: usb@1:1 logical name: wlan5 serial: cc:d2:9b:2f:e9:e0 capabilities: ethernet physical wireless configuration: broadcast=yes driver=rtl8188eu ip=192.168.7.101 multicast=yes wireless=IEEE 802.11bg *-network:2 description: Ethernet interface physical id: 3 logical name: eth0 serial: 02:c7:08:c2:14:c3 size: 10Mbit/s capacity: 100Mbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=sunxi_emac driverversion=1.01 duplex=half link=no multicast=yes port=MII speed=10Mbit/s
The output of lshw contain copious amounts of information about every aspects of your pc hardware. If you feel overwhelmed by the sheer amount of details, you can use the option -short to get an abridged version of the output.
$ sudo lshw -short
H/W path Device Class Description ======================================== system Computer /0 bus Motherboard /0/0 memory 875MiB System memory /0/1 processor /1 usb0 network Ethernet interface /2 wlan5 network Wireless interface /3 eth0 network Ethernet interface As you can see in the preceeding output, lshw classifies different parts of the hardware using classes. So if you want to see only the information related to a particular class such as memory, you can run the lshw command using the -class option as follows : $ sudo lshw -class memory *-memory description: System memory physical id: 0 size: 875MiB
… which will provide you detailed specifications about your computer’s memory and little else.
To get a list of all the classes identified by
lshw, you can execute it using the
Get lshw output in multiple formats
lshw command provides output in multiple file formats. For example, you can get the output in HTML, XML, text and a few more.
For instance, to get the output in HTML, you use the
-html option as follows :
$ sudo lshw -html > hardware-info.html
… And it presents the output in a nice HTML format.
lshw command also has an equivalent GUI which is available as the
lshw-gtk package in Debian based Linux distributions. In Ubuntu, you can install lshw GUI as follows :
$ sudo apt-get install lshw-gtk
This GUI tool provides all the details in a very user friendly and structured manner which any lay person can understand.
To sum up, identifying all the PC hardware in Linux such as processors, memory, chipset, audio and video is made easy using the