linux 查询cpu版本、核心、线程脚本
#!/bin/bash #1.查看物理cpu个数 physical=`cat /proc/cpuinfo |grep 'physical id'|sort -u|wc -l` echo 物理cpu个数: "$physical" #2.查看核心数量 core=`grep 'core id' /proc/cpuinfo | sort -u | wc -l` echo 核心数: "$core" #3.查看线程数 processor=`grep 'processor' /proc/cpuinfo | sort -u | wc -l` echo 线程数:"$processor" #4.查看cpu型号 cpu=`dmidecode -s processor-version` echo -e 'cpu型号:\n'"$cpu"