Ubuntu查看cpu信息
1. 查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
# 输出结果
# 1 # 即表示总计1个物理CPU。
2. 查看CPU型号
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
# 输出结果
# 12 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz # CPU的型号信息
3. 查看cpu核数
cat /proc/cpuinfo| grep "cpu cores"| uniq
# 输出结果
# cpu cores : 6 # CPU核数
4. 查看逻辑CPU个数
cat /proc/cpuinfo| grep "processor"| wc -l
# 输出结果
# 12 # 逻辑CPU=物理CPU*CPU核数*超线程数