#!/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 # 删除脚本,并清除历史命令