当前位置:  操作系统/服务器>linux
本页文章导读:
    ▪linux下dmidecode命令查看内存型号的方法      机器主板是nVidia Corporation MCP61,系统内存支持双通道内存技术。 配置了4个DDRII DIMM插槽,支持DDRII 800/667/533内存,最大支持8G容量。 为了尝试下双通道内存技术,准备加一条与原来完全一样的.........
    ▪linux下查看内存条数及每根内存大小的方法      在linux系统中,查看内存条个数,及每根内存的大小,可以使用dmidecode命令。 如下: 代码示例: #dmidecode | grep -A16 "Memory Device$" 输出结果: Memory Device #存储设备 Array Handle: 0x1000 #阵列处理 Er.........
    ▪linux下查看CPU,内存,机器型号,网卡等信息的方法      1,查看CPU信息(型号)   代码示例: # cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c       8  Intel(R) Xeon(R) CPU            E5410   @ 2.33GHz (看到有8个逻辑CPU, 也知道了CPU型号) # cat /proc/cpui.........

[1]linux下dmidecode命令查看内存型号的方法
    来源: 互联网  发布时间: 2013-12-24

机器主板是nVidia Corporation MCP61,系统内存支持双通道内存技术。
配置了4个DDRII DIMM插槽,支持DDRII 800/667/533内存,最大支持8G容量。

为了尝试下双通道内存技术,准备加一条与原来完全一样的内存条。
电脑配置上只写了kingston DDRII512M。

接下来就要用工具dmidecode(DMI table decoder)确定下内存频率了。

dmidecode命令可以全面的显示你系统的信息,包括bios、cpu、内存等信息。

例如:
[root@localhost testcase]$ sudo 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
 

[root@localhost testcase]$ sudo dmidecode -t memory

# dmidecode 2.7
SMBIOS 2.4 present.
Handle 0x0007, DMI type 5, 24 bytes.
Memory Controller Information
Error Detecting Method: 64-bit ECC
Error Correcting Capabilities:
None
Supported Interleave: One-way Interleave
Current Interleave: One-way Interleave
Maximum Memory Module Size: 2048 MB
Maximum Total Memory Size: 8192 MB
Supported Speeds:
70 ns
60 ns
Supported Memory Types:
DIMM
SDRAM
Memory Module Voltage: 3.3 V
Associated Memory Slots: 4
0x0008
0x0009
0x000A
0x000B
Enabled Error Correcting Capabilities:
None
Handle 0x0008, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM0
Bank Connections: 0 1
Current Speed: Unknown
Type: ECC DIMM
Installed Size: 512 MB (Single-bank Connection)
Enabled Size: 512 MB (Single-bank Connection)
Error Status: OK
Handle 0x0009, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM1
Bank Connections: None
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK
Handle 0x000A, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM2
Bank Connections: None
Current Speed: Unknown
Type: Unknown

Installed Size: Not Installed

Enabled Size: Not Installed

Error Status: OK

Handle 0x000B, DMI type 6, 12 bytes.

Memory Module Information

Socket Designation: DIMM3

Bank Connections: None

Current Speed: Unknown

Type: Unknown

Installed Size: Not Installed

Enabled Size: Not Installed

Error Status: OK

Handle 0x0010, DMI type 16, 15 bytes.

Physical Memory Arroot

Location: System Board Or Motherboard

Use: System Memory

Error Correction Type: None

Maximum Capacity: 8 GB

Error Information Handle: Not Provided

Number Of Devices: 4

Handle 0x0012, DMI type 17, 27 bytes.

Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 72 bits
Size: 512 MB
Form Factor: DIMM
Set: None
Locator: DIMM0
Bank Locator: BANK0
Type: DDR2
Type Detail: Synchronous
Speed: 533 MHz (1.9 ns)
Manufacturer: Manufacturer0
Serial Number: SerNum0
Asset Tag: AssetTagNum0
Part Number: PartNum0
Handle 0x0014, DMI type 17, 27 bytes.

Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM1
Bank Locator: BANK1
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer1
Serial Number: SerNum1
Asset Tag: AssetTagNum1
Part Number: PartNum1
Handle 0x0016, DMI type 17, 27 bytes.

Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM2
Bank Locator: BANK2
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer2
Serial Number: SerNum2
Asset Tag: AssetTagNum2
Part Number: PartNum2
Handle 0x0018, DMI type 17, 27 bytes.

Memory Device
Arroot Handle: 0x0010
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: 64 bits
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: DIMM3
Bank Locator: BANK3
Type: Unknown
Type Detail: Unknown
Speed: Unknown
Manufacturer: Manufacturer3
Serial Number: SerNum3
Asset Tag: AssetTagNum3
Part Number: PartNum3

 

总结:
在Memory Controller Information中,可以看到最大的内存大小是8G,支持内存种类为DIMM和SDRAM。有四个Memory Slots。对应接下来的4个Memory Module Information。
DMI type 16 (man dmidecode里面有DMI TYPES specification)的意思是 Physical Memory Arroot。

最大支持内存为8G, 有4个内存设备。最后则列出具体的4个内存设备,其中发现了一个内存设备为512M,类型Type:DDR2, 工作频率Speed: 533 MHz (1.9 ns)。这个就我
目前电脑上的那根内存条。


    
[2]linux下查看内存条数及每根内存大小的方法
    来源: 互联网  发布时间: 2013-12-24

在linux系统中,查看内存条个数,及每根内存的大小,可以使用dmidecode命令。

如下:

代码示例:
#dmidecode | grep -A16 "Memory Device$"

输出结果:

Memory Device #存储设备
Array Handle: 0x1000 #阵列处理
Error Information Handle: Not Provided #错误信息的处理:不提供
Total Width: 72 bits #总宽度: 72位
Data Width: 64 bits #数据宽度: 64位
Size: 1024 MB #大小
Form Factor:
Set: 1
Locator: DIMM1
Bank Locator: Not Specified
Type:
Type Detail: Synchronous #输入详细信息:同步
Speed: 667 MHz (1.5 ns) #速度: 667兆赫( 1.5纳秒)
Manufacturer: 80AD7FB380AD #制造商
Serial Number: 42600700 #序号
Asset Tag: 010910
Part Number: HYMP112F72CP8D3-Y5
--
//by www.
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor:
Set: 1
Locator: DIMM2
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 80AD7FB380AD
Serial Number: 42600213
Asset Tag: 010910
Part Number: HYMP112F72CP8D3-Y5
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor:
Set: 2
Locator: DIMM3
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 855185518551
Serial Number: 0503BE1A
Asset Tag: 4C0838
Part Number: 72T128401EFA3SC2
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor:
Set: 2
Locator: DIMM4
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: 667 MHz (1.5 ns)
Manufacturer: 855185518551
Serial Number: 0503BF1F
Asset Tag: 4C0838
Part Number: 72T128401EFA3SC2
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor:
Set: 3
Locator: DIMM5
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor:
Set: 3
Locator: DIMM6
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor:
Set: 4
Locator: DIMM7
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:
--//by www.
Memory Device
Array Handle: 0x1000
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: No Module Installed
Form Factor:
Set: 4
Locator: DIMM8
Bank Locator: Not Specified
Type:
Type Detail: Synchronous
Speed: Unknown
Manufacturer:
Serial Number:
Asset Tag:
Part Number:

然后,用free命令查看当前内存的使用情况:
 

代码示例:
# free -m
total used free shared buffers cached
Mem: 4054 2963 1090 0 144 1272
-/+ buffers/cache: 1547 2506
Swap: 4094 0 4094

    
[3]linux下查看CPU,内存,机器型号,网卡等信息的方法
    来源: 互联网  发布时间: 2013-12-24

1,查看CPU信息(型号)
 

代码示例:

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Xeon(R) CPU            E5410   @ 2.33GHz
(看到有8个逻辑CPU, 也知道了CPU型号)

# cat /proc/cpuinfo | grep physical | uniq -c
      4 physical id      : 0
      4 physical id      : 1
(说明实际上是两颗4核的CPU)
# 其实是可能有超线程HT技术,不一定是有4核,也可能是2核4线程。

# getconf LONG_BIT
   32
(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
   8
(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

完整查看cpu详细信息。
# dmidecode | grep -A81 'Processor Information'

2,查看主板型号:
 

代码示例:
# dmidecode |grep -A16 "System Information$"

3,内存槽及内存条:
 

代码示例:
# dmidecode |grep -A16 "Memory Device$"

4,查看内存信息
 

代码示例:
# cat /proc/meminfo

5,其它
 

代码示例:

# uname -a
Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
(查看当前操作系统内核信息)

# cat /etc/issue | grep Linux
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
(查看当前操作系统发行版信息)

查看机器型号
# dmidecode | grep "Product Name" 

查看网卡信息
# dmesg | grep -i eth

# mii-tool

硬盘:
# fdisk -l
# smartctl -a /dev/sda

就介绍这些吧,对于linux系统而言,通过命令获知以上信息足够了,对于了解系统的硬件情况,已经很全面了。
有兴趣的朋友,在自己的linux下测试下吧,只有多练习,linux命令才会掌握的更快、更好哦。


    
最新技术文章:
▪linux系统中的列出敏感用户的脚本代码
▪a10 config backup for aXAPI
▪一键备份gitolite服务器的Shell脚本
▪nagios 分发文件实现代码
▪阿里云云服务器Linux系统更新yum源Shell脚本
▪一个监控LINUX目录和文件变化的Shell脚本分享
▪Linux下实现SSH免密码登录和实现秘钥的管理、...
▪Shell正则表达式之grep、sed、awk实操笔记
▪3个备份系统文件并邮件发送的Shell脚本分享
▪CentOS 6.3下给PHP添加mssql扩展模块教程
▪监控网站是否可以正常打开的Shell脚本分享
▪shell脚本编程之if语句学习笔记
▪shell脚本编程之循环语句学习笔记
▪shell脚本编程之case语句学习笔记
▪Shell脚本实现的阳历转农历代码分享
▪Shell脚本实现复制文件到多台服务器的代码分...
▪Shell脚本实现批量下载网络图片代码分享
▪Shell脚本实现检测文件是否被修改过代码分享
▪Shell脚本数组用法小结
▪Shell脚本批量重命名文件后缀的3种实现
▪C语言实现的ls命令源码分享
▪Linux下查找后门程序 CentOS 查后门程序的shell脚...
▪Shell 函数参数
▪linux shell 自定义函数方法(定义、返回值、变...
▪Shell实现判断进程是否存在并重新启动脚本分...
▪Shell脚本break和continue命令简明教程
▪Shell脚本函数定义和函数参数
▪让代码整洁、过程清晰的BASH Shell编程技巧
▪shell常用重定向实例讲解
▪awk中RS、ORS、FS、OFS的区别和联系小结
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3