dmidecode 用于获取主机的硬件信息,通常是在不打开计算机机箱的情况下使用该命令来查找硬件详细信息,其输出的信息包括BIOS、系统、主板、处理器、内存、缓存等等。
常用用法如下(需要root权限):
[root@localhost ~]$ dmidecode # 打印所有硬件信息 [root@localhost ~]$ dmidecode -q # 打印所有硬件信息,比较简洁
[root@localhost ~]$ dmidecode -h # 获取帮助 [root@localhost ~]$ dmidecode | grep ‘Product Name‘ # 以过滤的方式来查看指定的硬件信息 [root@localhost ~]$ dmidecode --type bios # 查看BIOS相关的硬件信息 [root@localhost ~]$ dmidecode --type system # 查看系统相关的硬件信息 [root@localhost ~]$ dmidecode --type baseboard # 查看主板相关的硬件信息 [root@localhost ~]$ dmidecode --type chassis # 查看机箱相关的硬件信息 [root@localhost ~]$ dmidecode --type processor # 查看处理器相关的硬件信息,命令也可以用dmidecode -t 4 [root@localhost ~]$ dmidecode --type memory # 查看内存相关的硬件信息
[root@localhost ~]$ dmidecode -t 0,4 # 等价于dmidecode -t 0和dmidecode -t 4 dmidecode支持的类型: Type Information -------------------------------------------- 0 BIOS 1 System 2 Baseboard 3 Chassis 4 Processor 5 Memory Controller 6 Memory Module 7 Cache 8 Port Connector
要获得处理器方面的信息,示例如下:
[root@localhost ~]# dmidecode -t 4 # dmidecode 2.11 SMBIOS 2.5 present. Handle 0x0001, DMI type 4, 40 bytes #执行的命令中--type使用-t替代,processor关键字使用此type编号替代 Processor Information Socket Designation: Node 1 Socket 1 Type: Central Processor Family: Xeon MP Manufacturer: Intel(R) Corporation id: C2 06 02 00 FF FB EB BF Signature: Type 0, Family 6, Model 44, Stepping 2 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) ss (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Xeon(R) CPU E5620 @ 2.40GHz Voltage: 1.2 V External Clock: 5866 MHz Max Speed: 4400 MHz Current Speed: 2400 MHz Status: Populated, Enabled Upgrade: ZIF Socket L1 Cache Handle: 0x0002 L2 Cache Handle: 0x0003 L3 Cache Handle: 0x0004 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Core Count: 4 Core Enabled: 4 Thread Count: 8 Characteristics: 64-bit capable Handle 0x0055, DMI type 4, 40 bytes Processor Information Socket Designation: Node 1 Socket 2 Type: Central Processor Family: Xeon MP Manufacturer: Not Specified ID: 00 00 00 00 00 00 00 00 Signature: Type 0, Family 0, Model 0, Stepping 0 Flags: None Version: Not Specified Voltage: 1.2 V External Clock: 5866 MHz Max Speed: 4400 MHz Current Speed: Unknown Status: Unpopulated Upgrade: ZIF Socket L1 Cache Handle: Not Provided L2 Cache Handle: Not Provided L3 Cache Handle: Not Provided Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Characteristics: None
打印所以硬件信息(简洁)示例如下:
[root@localhost ~]$ dmidecode -q //BIOS相关的硬件信息 BIOS Information Vendor: Bochs Version: Bochs Release Date: 01/01/2011 Address: 0xE8000 Runtime Size: 96 kB ROM Size: 64 kB Characteristics: BIOS characteristics not supported Targeted content distribution is supported BIOS Revision: 1.0 //系统相关的硬件信息 System Information Manufacturer: Bochs # 厂商 Product Name: Bochs # 服务器型号 Version: Not Specified # 版本号 Serial Number: 641ab5b5-f6c0-431f-864c-4e750d27de04 # 主板序列号 UUID: 641AB5B5-F6C0-431F-864C-4E750D27DE04 # UUID Wake-up Type: Power Switch SKU Number: Not Specified Family: Not Specified //机箱相关的硬件信息 Chassis Information Manufacturer: Bochs Type: Other Lock: Not Present Version: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Boot-up State: Safe Power Supply State: Safe Thermal State: Safe Security Status: Unknown OEM Information: 0x00000000 Height: Unspecified Number Of Power Cords: Unspecified //处理器相关的硬件信息 Processor Information Socket Designation: CPU 1 Type: Central Processor Family: Other Manufacturer: Bochs ID: F1 06 04 00 FF FB 8B 1F Version: Not Specified Voltage: Unknown External Clock: Unknown Max Speed: 2000 MHz Current Speed: 2000 MHz Status: Populated, Enabled Upgrade: Other //物理内存阵列 Physical Memory Array Location: Other Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 2 GB Number Of Devices: 1 //内存设备 Memory Device Total Width: 64 bits Data Width: 64 bits Size: 2048 MB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: Not Specified Type: RAM Type Detail: None //内存阵列映射地址 Memory Array Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0007FFFFFFF Range Size: 2 GB Partition Width: 1 //内存设备映射地址 Memory Device Mapped Address Starting Address: 0x00000000000 Ending Address: 0x0007FFFFFFF Range Size: 2 GB Partition Row Position: 1 //系统引导 System Boot Information Status: No errors detected
参考文档:
原文:https://www.cnblogs.com/badboy200800/p/12294029.html