(1)逻辑CPU个数: # cat /proc/cpuinfo | grep "processor" | wc -l (2)物理CPU个数: # cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l (3)每个物理CPU中逻辑CPU的个数:
写法一: ---------------------------------------------------------------------------- #!/bin/bash while read line do echo $line done < file(待读取的文件) -------------------------
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号