在linux中如果需要查看硬件信息的话,最常用也是最好用的命令,也就数dmidecode了。
安装dmidecode命令:
不带选项执行 dmidecode,会输出所有的硬件信息。
执行 dmidecode 后,输出类似这样的结果:
# dmidecode 2.10
SMBIOS 2.3 present.
26 structures occupying 1285 bytes.
Table at 0x000FC010.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: American Megatrends Inc.
Version: 080012
Release Date: 02/06/2007
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 512 kB
...
另外,Dmidecode 有个很有用的选项 -t,可以按指定类型输出相关信息。
如果要获得处理器方面的信息,则可以执行:
输出结果:
# dmidecode 2.10
SMBIOS 2.3 present.
Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: CPU 1
Type: Central Processor
Family: Unknown
Manufacturer: Intel
ID: F2 06 00 00 FF FB EB BF
Version: Genuine Intel(R) CPU 2140 @ 1.60GHz
Voltage: 1.3 V
External Clock: 200 MHz
Max Speed: 1600 MHz
Current Speed: 1600 MHz
Status: Populated, Enabled
Upgrade: Other
L1 Cache Handle: 0x0005
L2 Cache Handle: 0x0006
L3 Cache Handle: 0x0007
Serial Number: To Be Filled By O.E.M.
Asset Tag: To Be Filled By O.E.M.
Part Number: To Be Filled By O.E.M.
要查看 Dmidecode 的更多选项与用法,在命令后加上 -h 选项查询即可。
当然,也可以查看它的man手册。