1.查看服务器型号、序列号:

[root@localhots ~]#dmidecode|grep “System Information” -A9|egrep “Manufacturer|Product|Serial”
Manufacturer: HP
Product Name: ProLiant DL360 G6
Serial Number: JPT0012J2W

2.Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:

[root@localhost ~]#dmidecode|grep -A5 “Memory Device”|grep Size|grep -v Range
Size: No Module Installed
Size: No Module Installed
Size: 4096 MB
Size: No Module Installed
Size: No Module Installed
Size: 4096 MB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: 4096 MB
Size: No Module Installed
Size: No Module Installed
Size: 4096 MB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed

3.Linux 查看内存的频率:

[root@localhost ~]#dmidecode|grep -A16 “Memory Device”|grep ‘Speed’
Speed: Unknown
Speed: Unknown
Speed: 1067 MHz
Speed: Unknown
Speed: Unknown
Speed: 1067 MHz
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: Unknown
Speed: 1067 MHz
Speed: Unknown
Speed: Unknown
Speed: 1067 MHz
Speed: Unknown
Speed: Unknown
Speed: Unknown

4.查看cpu的统计信息:

[root@localhost ~]# lscpu #->如该命令找不到,请安装软件包util-linux-ng
Architecture: x86_64 #->cpu架构
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian #->小尾序
CPU(s): 8 #->总共有8核
On-line CPU(s) list: 0-7
Thread(s) per core: 1 #->每个cpu核,只能支持一个线程,即不支持超线程
Core(s) per socket: 4 #->每个cpu,有4个核
Socket(s): 2 #->总共有2一个cpu
NUMA node(s): 2
Vendor ID: GenuineIntel #->cpu产商 intel
CPU family: 6
Model: 26
Stepping: 5
CPU MHz: 2266.877
BogoMIPS: 4532.68
Virtualization: VT-x #->支持cpu虚拟化技术
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0,2,4,6
NUMA node1 CPU(s): 1,3,5,7

5.查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等:

[root@localhost ~]#cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 26
model name : Intel(R) Xeon(R) CPU E5520 @ 2.27GHz
…..
…..
…..

#->上面输出的是第一个cpu部分信息,还有7个cpu信息省略了

6.查看物理CPU个数:

[root@localhost ~]# grep “physical id” /proc/cpuinfo | sort -u
physical id : 0
physical id : 1

7.查看CPU核心数:

[root@localhost ~]# grep ‘core id’ /proc/cpuinfo | sort -u | wc -l
4

8.查看CPU线程数:

[root@localhost ~]# grep ‘processor’ /proc/cpuinfo | sort -u | wc -l
8