Linux – Get More Information About Hardware

Below are some Linux commands to get information about hardware.

1.  List Storage Devices : lsblk 

# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 99G 0 part
├─centos_station1-root 253:0 0 97G 0 lvm /
└─centos_station1-swap 253:1 0 2G 0 lvm [SWAP]

2.  List CPU Information : lscpu 

# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 151
Model name: 12th Gen Intel(R) Core(TM) i7-12700F

3.  List Memory Information : lsmem

# lsmem
RANGE SIZE STATE REMOVABLE BLOCK
0x0000000000000000-0x0000000007ffffff 128M online no 0
0x0000000008000000-0x000000002fffffff 640M online yes 1-5
0x0000000030000000-0x0000000037ffffff 128M online no 6
0x0000000038000000-0x00000000a7ffffff 1.8G online yes 7-20
0x00000000a8000000-0x00000000afffffff 128M online no 21
0x00000000b0000000-0x00000000bfffffff 256M online yes 22-23
0x00000000c0000000-0x00000000f7ffffff 896M online no 24-30
0x0000000100000000-0x0000000107ffffff 128M online no 32

Memory block size: 128M
Total online memory: 4G
Total offline memory: 0B

4.  List SCSI Devices : lsscsi

# lsscsi
[2:0:0:0] disk Msft Virtual Disk 1.0 /dev/sda

5.  List PCI Devices : lspci

# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA

6.  List USB Devices : lsusb

# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

7.  List All Hardware : lshw

# lshw
station1.example.com
description: Desktop Computer
product: Virtual Machine
vendor: Microsoft Corporation
version: 7.0
serial: 3038-2041-7931-5098-8172-7068-46
width: 64 bits . . .

8.  Get Information About Hardware Clock : hwclock

# hwclock
Monday 27 November 2023 10:23:46 AM IST -1.048376 seconds

9.  Get Information About System Management BIOS : dmidecode

# dmidecode 
# dmidecode 2.12-dmifs
SMBIOS 2.8 present.
87 structures occupying 4291 bytes.
Table at 0xC2DF4000.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
Vendor: American Megatrends Inc.
Version: 0305
Release Date: 06/28/2018
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 16384 kB
Characteristics:
PCI is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed

10.  More About CPU : 

# cat /proc/cpuinfo 
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 151
model name : 12th Gen Intel(R) Core(TM) i7-12700F

11.  More About Memory : 

# cat /proc/meminfo 
MemTotal: 4044316 kB
MemFree: 3268836 kB
MemAvailable: 3611988 kB
Buffers: 2136 kB
Cached: 535012 kB
SwapCached: 0 kB