Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zlei1/60b19cb87f6cda11e0e6823d79d58995 to your computer and use it in GitHub Desktop.
Save zlei1/60b19cb87f6cda11e0e6823d79d58995 to your computer and use it in GitHub Desktop.
查看物理cpu个数
cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
查看核心数量
grep 'core id' /proc/cpuinfo | sort -u | wc -l
cat /proc/cpuinfo | grep "cpu cores" | wc -l
查看线程数
grep 'processor' /proc/cpuinfo | sort -u | wc -l
查看cpu型号
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
如果服务器有2个cpu,每个cpu4个核心,每个核心4线程,共16线程。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment