软著统计软件环境Linux命令
[ruanzhu@host ~]$ #查看内存总数
[ruanzhu@host ~]$ cat /proc/meminfo | grep MemTotal
MemTotal: 263531624 kB
[ruanzhu@host ~]$ free -h
total used free shared buff/cache available
Mem: 251G 45G 154G 1.3G 51G 203G
Swap: 4.0G 0B 4.0G
[ruanzhu@host ~]$ #Linux查看当前操作系统版本信息
[ruanzhu@host ~]$ cat /proc/version
Linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017
[ruanzhu@host ~]$ #Linux查看版本当前操作系统发行版信息(红帽)
[ruanzhu@host ~]$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
CPU型号为Intel® Xeon® Gold 5218R,总共两个物理CPU,每个20核,即双CPU,40核;逻辑CPU 80个,命令如下:
[ruanzhu@host ~]$ #查看CPU型号
[ruanzhu@host ~]$ cat /proc/cpuinfo | grep name | uniq -c
80 model name : Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz
[ruanzhu@host ~]$ # 查看物理CPU个数
[ruanzhu@host ~]$ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2
[ruanzhu@host ~]$ # 查看物理CPU核数
[ruanzhu@host ~]$ cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 20
[ruanzhu@host ~]$ # 查看逻辑CPU的个数
[ruanzhu@host ~]$ cat /proc/cpuinfo| grep "processor"| wc -l
80