当前位置: 首页 > news >正文

Ubuntu命令查看CPU信息

资料网络收集而来,出处不明。

如何查看电脑CPU核数
more /proc/cpuinfo |grep "physical id"|uniq|wc -l

每个cpu是几核(假设cpu配置相同)
more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l
cat /proc/cpuinfo | grep processor

1. 查看物理CPU的个数
#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
 
2. 查看逻辑CPU的个数
#cat /proc/cpuinfo |grep "processor"|wc -l
 
3. 查看CPU是几核(查看每个物理CPU中core的个数,即核数)
#cat /proc/cpuinfo |grep "cores"|uniq
#cat /proc/cpuinfo| grep "cpu cores"| uniq


4. 查看CPU的主频
#cat /proc/cpuinfo |grep MHz|uniq

 

# uname -a

Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux

(查看当前操作系统内核信息)

# cat /etc/issue | grep Linux

Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

(查看当前操作系统发行版信息)

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

      8  Intel(R) Xeon(R) CPU            E5410   @ 2.33GHz

(看到有8个逻辑CPU, 也知道了CPU型号)

# cat /proc/cpuinfo | grep physical | uniq -c

      4 physical id      : 0

      4 physical id      : 1

(说明实际上是两颗4核的CPU)

# getconf LONG_BIT

32

(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

8

(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

如何获得CPU的详细信息:

linux命令:cat /proc/cpuinfo

用命令判断几个物理CPU,几个核等:

逻辑CPU个数:
# cat /proc/cpuinfo | grep "processor" | wc -l

物理CPU个数:
# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

每个物理CPU中Core的个数:
# cat /proc/cpuinfo | grep "cpu cores" | wc -l

是否为超线程?
如果有两个逻辑CPU具有相同的”core id”,那么超线程是打开的。

每个物理CPU中逻辑CPU(可能是core, threads或both)的个数:
# cat /proc/cpuinfo | grep "siblings"

相关文章:

  • ROS报错: Unable to communicate with master
  • ROS报错:Roslaunch got a ‘No such file or directory‘ error while attempting to run xterm -e gdb --args
  • Ubuntu下的录屏工具Kazam和SimpleScreenRecorder, Peek
  • Ubuntu20.04+gdb/vscode调试ROS(VINS-Mono)程序
  • Windows 10上安装ROS noetic平台
  • Ubuntu查看环境变量
  • 四元素(四元数quaternion)的理解
  • SLAM算法资料收集
  • Ubuntu查看网卡信息
  • GDB最常用的命令
  • Ubuntu20.04+vscode快速调试ROS通用程序
  • ROS-Tutorials:rviz之Markers: Sending Basic Shapes (C++,附vscode调试说明)
  • Qt Creator 的下载与安装
  • Ubuntu20.04突然丢失网络时恢复的办法
  • Linux设置访问权限
  • @angular/forms 源码解析之双向绑定
  • cookie和session
  • LeetCode29.两数相除 JavaScript
  • Ruby 2.x 源代码分析:扩展 概述
  • SegmentFault 2015 Top Rank
  • spark本地环境的搭建到运行第一个spark程序
  • SpringBoot几种定时任务的实现方式
  • 一些基于React、Vue、Node.js、MongoDB技术栈的实践项目
  • Salesforce和SAP Netweaver里数据库表的元数据设计
  • ​软考-高级-信息系统项目管理师教程 第四版【第19章-配置与变更管理-思维导图】​
  • # centos7下FFmpeg环境部署记录
  • #我与Java虚拟机的故事#连载04:一本让自己没面子的书
  • #我与Java虚拟机的故事#连载05:Java虚拟机的修炼之道
  • #我与Java虚拟机的故事#连载10: 如何在阿里、腾讯、百度、及字节跳动等公司面试中脱颖而出...
  • (+3)1.3敏捷宣言与敏捷过程的特点
  • (+4)2.2UML建模图
  • (Matlab)遗传算法优化的BP神经网络实现回归预测
  • (八)Flask之app.route装饰器函数的参数
  • (超简单)使用vuepress搭建自己的博客并部署到github pages上
  • (二)JAVA使用POI操作excel
  • (附源码)spring boot北京冬奥会志愿者报名系统 毕业设计 150947
  • (附源码)springboot掌上博客系统 毕业设计063131
  • (万字长文)Spring的核心知识尽揽其中
  • (转)Windows2003安全设置/维护
  • ****** 二十三 ******、软设笔记【数据库】-数据操作-常用关系操作、关系运算
  • *1 计算机基础和操作系统基础及几大协议
  • .NET 3.0 Framework已经被添加到WindowUpdate
  • .net core 3.0 linux,.NET Core 3.0 的新增功能
  • .NET Remoting Basic(10)-创建不同宿主的客户端与服务器端
  • .NET Standard、.NET Framework 、.NET Core三者的关系与区别?
  • .net 打包工具_pyinstaller打包的exe太大?你需要站在巨人的肩膀上-VC++才是王道
  • .net程序集学习心得
  • /dev/VolGroup00/LogVol00:unexpected inconsistency;run fsck manually
  • [ IOS ] iOS-控制器View的创建和生命周期
  • [ vulhub漏洞复现篇 ] Celery <4.0 Redis未授权访问+Pickle反序列化利用
  • [145] 二叉树的后序遍历 js
  • [BZOJ 2142]礼物(扩展Lucas定理)
  • [bzoj4240] 有趣的家庭菜园
  • [C++]类和对象(中)
  • [iOS]-NSTimer与循环引用的理解