Chinaunix首页 | 论坛 | 博客
  • 博客访问: 431077
  • 博文数量: 125
  • 博客积分: 2838
  • 博客等级: 少校
  • 技术积分: 1410
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-05 09:45
文章分类

全部博文(125)

文章存档

2012年(13)

2011年(5)

2010年(107)

我的朋友

分类: LINUX

2011-01-24 18:05:44

1. 最简单的的显示全部信息:
# dmidecode

2.更精简的信息显示:
# dmidecode -q
-q(–quite) 只显示必要的信息

3.显示指定类型的信息:
使用-t(–type TYPE)来指定信息类型:
# dmidecode -t bios
# dmidecode -t 0,4 (显示bios和processor)

文本参数支持:
bios, system, baseboard, chassis, processor, memory, cache, connector, slot

数字参数支持:
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device

4.通过关键字查看信息:
只想查看序列号,可以使用:
# dmidecode -s system-serial-number
-s (–string keyword)支持的keyword包括:
————————————————————————————-
bios-vendor,bios-version, bios-release-date,
system-manufacturer, system-product-name, system-version, system-serial-number,
baseboard-manu-facturer,baseboard-product-name, baseboard-version, baseboard-serial-number, baseboard-asset-tag,
chassis-manufacturer, chas-sis-version, chassis-serial-number, chassis-asset-tag,
processor-manufacturer, processor-version.
————————————————————————————-

5.高级示例:


机器插内存情况

dmidecode |grep -P -A 5  "Memory\s+Device"|grep Size:|grep -v Range

机器最大支持内存

dmidecode |grep -P "Maximum\s+Capacity"


查看主板的序列号:
dmidecode | grep 'Serial Number'

dmidecode | grep 'Serial Number' | awk '{print $3}' | tail -1

显示CPU信息

dmidecode |grep -A42 "Processor"|more

grep -An (A和n之间也可以有空格) 输出包含指定字符串的行及该行后续的n行

阅读(2335) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~