Centos7查看内存CPU等硬件信息

查看内存插槽占用情况

[root@xydev ~]# dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range
  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: 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

查看最大支持内存

[root@xydev ~]# dmidecode|grep -P 'Maximum\s+Capacity'
Maximum Capacity: 1536 GB
Maximum Capacity: 1536 GB

查看CPU核心数量

[root@xydev ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c
     40  Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz