• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >linux shell > Shell实现识别物理cpu个数、核心数

Shell实现识别物理cpu个数、核心数

作者:junjie 字体:[增加 减小] 来源:互联网

junjie 通过本文主要向大家介绍了shell 参数个数,shell 判断参数个数,shell 统计文件个数,shell 获取参数个数,shell 检查参数个数等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

如何识别物理cpu个数,几个核,是超线程还是多核心

判断依据:

1.具有相同core id的cpu是同一个core的超线程。
2.具有相同physical id的cpu是同一颗cpu封装的线程或者cores。

英文版:

1.Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthreads in the same core.
2.Any cpu with the same physical id are threads or cores in the same physical socket.

实例:

LunarPages的CPU信息:
processor        : 0
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 0
siblings        : 2
core id                : 0
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 6006.73
processor        : 1
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 0
siblings        : 2
core id                : 0
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 5999.40
processor        : 2
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 3
siblings        : 2
core id                : 3
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid level        : 5
wp                : yes
flags                : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid xtpr
bogomips        : 5999.08
processor        : 3
vendor_id        : GenuineIntel
cpu family        : 15
model                : 4
model name        : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 3
cpu MHz                : 3000.881
cache size        : 2048 KB
physical id        : 3
siblings        : 2
core id                : 3
cpu cores        : 1
fdiv_bug        : no
hlt_bug                : no
f00f_bug        : no
coma_bug        : no
fpu                : yes
fpu_exception        : yes
cpuid l

您可能想查找下面的文章:

  • Shell实现识别物理cpu个数、核心数
  • Shell最多支持多少个参数?

相关文章

  • linux crontab 实现每秒执行的实例
  • Shell编程 Bash引号的那点事
  • bash 编程中循环语句用法
  • shell脚本编写的俄罗斯方块游戏代码
  • linux whatis与whatis database 使用及查询方法(man使用实例)
  • Shell脚本实现监控MySQL主从同步
  • 分享一个实用的iptables脚本(各种过滤写法参考)
  • linux shell awk获得外部变量(变量传值)简介
  • linux shell之文件锁
  • linux和windows下的自动ftp脚本(shell bat)

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Shell命令批量修改图片文件名
    • linux查看目录的四种方法(ls只显示目录)
    • CCKiller:Linux轻量级CC攻击防御工具,秒级检查、自动拉黑和释放
    • Apache使用 .htaccess 来实现强制https访问的方法
    • shell脚本编程之if语句学习笔记
    • shell查找符号链接及其指向目标的方法介绍
    • shell实现自动adsl拨号并检测连接状况脚本分享
    • Shell脚本切割tomcat的日志文件
    • linux shell实现求一个多维数组中的最大和最小值
    • shell中的循环语句、判断语句实例

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有