首页 > 代码库 > 查看linux服务器内存信息

查看linux服务器内存信息

查看服务器内存信息

dmidecode|grep -P -A5 "Memory\s+Device"|grep Size

[root@localhost home]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size
Size: 16384 MB
Size: No Module Installed
Size: No Module Installed
Size: 16384 MB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: 16384 MB
Size: No Module Installed
Size: No Module Installed
Size: 16384 MB

 

查看共有多少个槽位
[root@localhost home]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|wc -l
24

 

查看共插了多少根内存条

[root@oraservbjdb01 ~]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|awk -F: ‘BEGIN{count=0}$2~/16384 MB/{count++}END{print "count="count}‘
count=32

 

查看linux服务器内存信息