Posted: . At: 10:48 PM. This was 10 years ago. Post ID: 6912
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

Linux commands to find out hardware information.

Linux hardware information commands.

There are many commands available for Linux that allow the user to get information about their hardware. Here is a handful of them.

The lshw command is very useful for getting information about your installed hardware.

ubuntu ~ $ sudo lshw -short
H/W path                                                                                                        Device  Class      Description
==============================================================================================================================================
                                                                                                                        system     HVM domU ()
/0                                                                                                                      bus        Motherboard
/0/0                                                                                                                    memory     96KiB BIOS
/0/1                                                                                                                    processor  Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
/0/2                                                                                                                    memory     System Memory
/0/2/0                                                                                                                  memory     1GiB DIMM RAM
/0/2/1                                                                                                                  memory     1GiB DIMM RAM
/0/3                                                                                                                    memory     96KiB BIOS
/0/4                                                                                                                    processor  CPU
/0/5                                                                                                                    memory     System Memory
/0/74567486745764985674876397573487563653874653875634865378653653485364753748653465348765348653865348756487365          generic
/0/6                                                                                                                    memory
/0/7                                                                                                                    memory
/0/100                                                                                                                  bridge     440FX - 82441FX PMC [Natoma]
/0/100/1                                                                                                                bridge     82371SB PIIX3 ISA [Natoma/Triton II]
/0/100/1.1                                                                                                              storage    82371SB PIIX3 IDE [Natoma/Triton II]
/0/100/1.3                                                                                                              bridge     82371AB/EB/MB PIIX4 ACPI
/0/100/2                                                                                                                display    GD 5446
/0/100/3                                                                                                                generic    Xen Platform Device
/1                                                                                                              eth0    network    Ethernet interface

The lshw utility may also be used to get information about a certain item like the CPU. Just use the -class parameter and the name of a certain class, i.e memory.

ubuntu ~ $ sudo lshw -class processor
  *-cpu:0
       description: CPU
       product: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
       vendor: Intel Corp.
       physical id: 1
       bus info: cpu@0
       slot: CPU 1
       size: 2394MHz
       capacity: 2394MHz
       width: 64 bits
       capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp x86-64 constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm xsaveopt fsgsbase bmi1 avx2 smep bmi2 erms invpcid
  *-cpu:1
       description: CPU
       vendor: Intel
       physical id: 4
       bus info: cpu@1
       slot: CPU 1
       size: 2394MHz
       capacity: 2394MHz

Another useful command is lscpu. This lists all of your installed CPU(s).

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 37
Stepping:              5
CPU MHz:               933.000
BogoMIPS:              4787.87
Virtualisation:        VT-x
L1d cache:             32K
L1 cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3

Use the lsusb command to list all installed USB devices. This is a good way to find out what hardware a laptop has easily.

Bus 002 Device 003: ID 054c:05ba Sony Corp. 
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 064e:a219 Suyin Corp. 1.3M WebCam (notebook emachines E730, Acer sub-brand)
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The lsblk command will show all of the block devices in your machine.

[homer@localhost ~]$ lsblk 
NAME   MAJ:MIN RM    SIZE RO TYPE MOUNTPOINT
sda      8:0    0  465.8G  0 disk 
├─sda1   8:1    0  212.3G  0 part 
├─sda2   8:2    0   32.2G  0 part 
└─sda3   8:3    0  218.6G  0 part /
sdb      8:16   0  465.8G  0 disk 
├─sdb1   8:17   0    430M  0 part 
├─sdb2   8:18   0   11.7G  0 part 
├─sdb3   8:19   0  451.2G  0 part 
├─sdb4   8:20   0      1K  0 part 
└─sdb5   8:21   0    2.5G  0 part 
sdc      8:32   0    1.8T  0 disk 
├─sdc1   8:33   0 1002.3G  0 part 
├─sdc2   8:34   0  683.4G  0 part 
└─sdc3   8:35   0  177.3G  0 part 
sdd      8:48   0    1.8T  0 disk 
└─sdd1   8:49   0    1.8T  0 part 
sdi      8:128  0    1.8T  0 disk 
└─sdi1   8:129  0    1.8T  0 part /run/media/homer/Seagate Backup Plus Drive
sdj      8:144  1    7.3G  0 disk 
├─sdj1   8:145  1    6.8G  0 part /run/media/homer/MEDIA
└─sdj2   8:146  1    502M  0 part 
sr0     11:0    1   1024M  0 rom

use the hdparm -i command to find out about your installed hard disks. I am pointing it at the /dev/sda disk to see what information I may glean from it.

[root@localhost Documents]# hdparm -i /dev/sda
 
/dev/sda:
 
 Model=ST3500418AS, FwRev=CC38, SerialNo=9VM6XCTQ
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-4,5,6,7
 
 * signifies the current active mode

Here is a related command. The drill command allows you to get information about DNS.

[root@localhost Documents]# drill
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 46069
;; flags: qr rd ra ; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 14 
;; QUESTION SECTION:
;; .	IN	NS
 
;; ANSWER SECTION:
.	469971	IN	NS	c.root-servers.net.
.	469971	IN	NS	l.root-servers.net.
.	469971	IN	NS	a.root-servers.net.
.	469971	IN	NS	d.root-servers.net.
.	469971	IN	NS	j.root-servers.net.
.	469971	IN	NS	k.root-servers.net.
.	469971	IN	NS	h.root-servers.net.
.	469971	IN	NS	m.root-servers.net.
.	469971	IN	NS	g.root-servers.net.
.	469971	IN	NS	f.root-servers.net.
.	469971	IN	NS	e.root-servers.net.
.	469971	IN	NS	i.root-servers.net.
.	469971	IN	NS	b.root-servers.net.
 
;; AUTHORITY SECTION:
 
;; ADDITIONAL SECTION:
a.root-servers.net.	124370	IN	A	198.41.0.4
a.root-servers.net.	124412	IN	AAAA	2001:503:ba3e::2:30
b.root-servers.net.	125091	IN	A	192.228.79.201
c.root-servers.net.	125091	IN	A	192.33.4.12
d.root-servers.net.	125092	IN	A	199.7.91.13
d.root-servers.net.	262573	IN	AAAA	2001:500:2d::d
e.root-servers.net.	125091	IN	A	192.203.230.10
f.root-servers.net.	125091	IN	A	192.5.5.241
f.root-servers.net.	357784	IN	AAAA	2001:500:2f::f
g.root-servers.net.	125091	IN	A	192.112.36.4
h.root-servers.net.	125091	IN	A	128.63.2.53
h.root-servers.net.	357784	IN	AAAA	2001:500:1::803f:235
i.root-servers.net.	125091	IN	A	192.36.148.17
j.root-servers.net.	125091	IN	A	192.58.128.30
 
;; Query time: 70 msec
;; SERVER: 192.168.1.1
;; WHEN: Mon Jan 27 22:03:21 2014
;; MSG SIZE  rcvd: 500

This command will list all Digital TV devices in your Linux system.

[root@localhost Documents]# lsdvb
 
		lsdvb: Simple utility to list PCI/PCIe DVB devices
		Version: 0.0.4
		Copyright (C) Manu Abraham
 
usb (0:0 -761274016:32767) on PCI Domain:0 Bus:0 Device:1 Function:0
	DEVICE:0 ADAPTER:0 FRONTEND:0 (Realtek RTL2832 (DVB-T)) 
		 FE_OFDM Fmin=174MHz Fmax=862MHz

And this very good command will list all installed hardware on your system that is on the PCI bus. As shown in this screenshot, you used to use the cat /proc/pci command, but that is deprecated these days. That screenshot is of a KDE desktop on Debian 3.0 in case you are wondering what distribution that is. I was using that on an old Pentium II 350 MMX with 192 Megabytes of RAM. You can comper the hardware specs of that old machine to my current one.

[homer@localhost ~]$ lspci
00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12)
00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 12)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1a.1 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1a.2 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1a.7 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06)
00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06)
00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1d.1 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1d.2 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB Universal Host Controller (rev 06)
00:1d.7 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Turks XT [Radeon HD 6670/7670]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Turks/Whistler HDMI Audio [Radeon HD 6000 Series]
03:00.0 SATA controller: JMicron Technology Corp. JMB363 SATA/IDE Controller (rev 02)
03:00.1 IDE interface: JMicron Technology Corp. JMB363 SATA/IDE Controller (rev 02)
04:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)
06:01.0 Ethernet controller: D-Link System Inc RTL8139 Ethernet (rev 10)
06:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
06:06.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
3f:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)
3f:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)
3f:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
3f:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)
3f:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
3f:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.