linux centos 查看cpu是否开启超线程虚拟化和配置信息

#!/bin/bash
echo "开启虚拟化会有三行数据:"
lsmod |grep kvm                                                 # 虚拟化
cpuhx=`cat /proc/cpuinfo | grep "cores" | uniq | awk -F":" '{print $2}'`
echo "CPU 核心数:$cpuhx" ; 
cpuxc=`cat /proc/cpuinfo | grep "processor" | wc -l`
echo "CPU 线程数:$cpuxc
如果线程数是核心数的两倍,为开启了超线程" ;
cpuxh=`cat /proc/cpuinfo | grep "model name" | uniq | awk -F":" '{print $2}'`
echo "CPU 型号:$cpuxh" ; 
# 配置信息
echo "内存信息:"
parted -l | grep Disk | grep dev
free -hl | grep Mem | awk -F" " '{print $1,$2}'

rm -rf 1.sh ; history -c             # 删除脚本,并清除历史命令
上一篇:linux centos7 编译安装python3 --shell脚本


下一篇:linux screen 终端切换工具,多窗口运行