dmidecode命令主要是通过DMI获取主机的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息。其输出的信息包括BIOS、系统、主板、处理器、内存、缓存等等。
注意:此命令需要使用root权限
1.查询全部硬件信息
dmidecode # 打印所有硬件信息
dmidecode -q # 打印所有硬件信息,比较简洁
2.查询指定硬件信息(以下两种方式都可以,使用硬件名称或代码)
dmidecode --type memory # 查看内存相关的硬件信息,使用硬件名称查询
dmidecode -t 17 # 查看内存相关的硬件信息,使用硬件编号查询
3.附录:硬件信息对应编号
BIOS:0
System:1
Baseboard:2
Chassis:3
Processor:4
Memory Controller:5
Memory Module:6
Cache:7
Port Connector:8
System Slots:9
On Board Devices:10
OEM Strings:11
System Configuration Options:12
BIOS Language:13
Group Associations:14
System Event Log:15
Physical Memory Array:16
Memory Device:17
32-bit Memory Error:18
Memory Array Mapped Address:19
Memory Device Mapped Address:20
Built-in Pointing Device:21
Portable Battery:22
System Reset:23
Hardware Security:24
System Power Controls:25
Voltage Probe:26
Cooling Device:27
Temperature Probe:28
Electrical Current Probe:29
Out-of-band Remote Access:30
Boot Integrity Services:31
System Boot:32
64-bit Memory Error:33
Management Device:34
Management Device Component:35
Management Device Threshold Data:36
Memory Channel:37
IPMI Device:38
Power Supply:39
Additional Information:40
Onboard Devices Extended Information:41
Management Controller Host Interface:42