1. 查看主板信息:dmidecode |grep -A16 "System Information$"
2. 查看cpu信息:CPU总核数 = 物理CPU个数 * 每颗物理CPU的核数
总逻辑CPU数 = 物理CPU个数 * 每颗物理CPU的核数 * 超线程数查看CPU信息(型号)
[root@esggy-clu-n003 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
24 Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
# 查看物理CPU个数
[root@esggy-clu-n003 ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2
# 查看每个物理CPU中core的个数(即核数)
[root@esggy-clu-n003 ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 6
# 查看逻辑CPU的个数
[root@esggy-clu-n003 ~]# cat /proc/cpuinfo| grep "processor"| wc -l
24
3. 查看内存信息:(需要安装rpm -qa|grep dmidecode)查看服务器型号、序列号:
[root@esggy-clu-n003 ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"
Manufacturer: Dell Inc.
Product Name: PowerEdge R720
Serial Number: 9NLH422
Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:
[root@esggy-clu-n003 ~]# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range
Size: 16384 MB
Size: 16384 MB
Size: 16384 MB
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: 16384 MB
Size: 16384 MB
Size: 16384 MB
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
Linux 查看内存的频率:
[root@esggy-clu-n003 ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
Speed: 1600 MHz
Speed: 1600 MHz
Speed: 1600 MHz
Speed: 1600 MHz
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: 1600 MHz
Speed: 1600 MHz
Speed: 1600 MHz
Speed: 1600 MHz
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
在linux查看内存型号的命令:
dmidecode -t memory
查看主板型号:
dmidecode |grep -A16 "System Information$"
内存槽及内存条:
dmidecode |grep -A16 "Memory Device$"
硬盘:
fdisk -l
smartctl -a /dev/sda
网卡:
mii-tool
4. 查看硬盘信息:[root@esggy-clu-n003 ~]# fdisk -l | grep "Disk /dev/sd"
Disk /dev/sdb: 1999.8 GB, 1999844147200 bytes
Disk /dev/sdc: 1999.8 GB, 1999844147200 bytes
Disk /dev/sda: 1999.8 GB, 1999844147200 bytes
Disk /dev/sde: 1999.8 GB, 1999844147200 bytes
Disk /dev/sdf: 1999.8 GB, 1999844147200 bytes
Disk /dev/sdg: 1999.8 GB, 1999844147200 bytes
Disk /dev/sdd: 1999.8 GB, 1999844147200 bytes
[root@esggy-clu-n003 ~]# fdisk -l | grep 1999.8 | wc -l
7