免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8005 | 回复: 6
打印 上一主题 下一主题

linux下查看硬件信息的指令dmidecode [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-10-08 11:20 |只看该作者 |倒序浏览
linux下查看硬件信息的指令,比如top,free等,还可以通过内核文件来看,比如/proc/cpuinfo,/proc/meminfo等,还有一个指令给大家介绍怎么查看硬件信息--dmidecode, 希望对大家有点用处,认为我说的比较肤浅的,也不要拍砖,目的在于大家相互交流嘛。
dmidecode是读取DMI的信息显示给大家的。
[root@mail proc]# dmidecode --help
Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem)
-h, --help             Display this help text and exit
-q, --quiet            Less verbose output
-s, --string KEYWORD   Only display the value of the given DMI string
-t, --type TYPE        Only display the entries of given type
-u, --dump             Do not decode the entries
-V, --version          Display the version and exit
以上是它的帮助信息,最有用的当然是参数-t了,它后面可跟的参数有:
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
类型归纳一下如下:
bios 0, 13
system 1, 12, 15, 23, 32
baseboard 2, 10
chassis 3
processor 4
memory 5, 6, 16, 17
cache 7
connector 8
slot 9

比如查看CPU信息:
dmidecode -t 4     或者  dmidecode -t porcessor
两者的功能是一样的,查看内存 dmidecode -t 5 或 dmidecode -t memory
最常用的可能就是这两个指令了,尤其是查看内存,dmidecode -t memory会显示哪个插槽插了内存,容量多大的以及频率等信息。

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2011-10-08 11:22 |只看该作者
楼主总结的不错,赞一个

论坛徽章:
1
天秤座
日期:2013-10-23 13:20:42
3 [报告]
发表于 2011-10-08 13:09 |只看该作者
dmidecode 再结合一下grep是蛮好的工具

求职 : Linux运维
论坛徽章:
0
4 [报告]
发表于 2011-11-07 12:58 |只看该作者
相当实用的东西,我来狗尾续貂一下自己常用的两个
查看服务器内存分布
dmidecode |grep -A20 "Memory Device$"|sed -n -e'/Locator/p' -e '/Size/p'|grep -v "Bank Locator"
查看主板信息
dmidecode|grep -A16 "System Information$" |sed -n -e '/Product/p' -e '/Serial/p'

论坛徽章:
0
5 [报告]
发表于 2012-03-26 15:38 |只看该作者
查看内存到底用哪个是 dmidecode -t 5还是6还是17 为什么我的查出来和proc/meminfo中的信息不一样呢?

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-07-29 06:20:00操作系统版块每日发帖之星
日期:2016-08-07 06:20:00
6 [报告]
发表于 2012-03-26 16:07 |只看该作者
[root@localhost ~]# dmidecode -t 5
-t: No such file or directory
[root@localhost ~]# dmidecode -t
-t: No such file or directory
[root@localhost ~]#

为什么我系统没有这个t参数 ,系统是rhel4.3

论坛徽章:
0
7 [报告]
发表于 2012-04-01 09:53 |只看该作者
回复 6# minirat

你需要安装一下dmidecode这个东西的。
如果是可以yum search dmidecode一下,然后根据你的系统情况安装一个相应的版本。就可以使用了。

在此回复,主要表示对楼主的关注。以及mark一下楼主这个总结。
   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP