查看“︁Linux/CPU”︁的源代码
来自康健生活
←
Linux/CPU
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 引言 == 查看 CPU 信息。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo </syntaxhighlight>|<syntaxhighlight lang="javascript"> processor : 0 vendor_id : GenuineIntel ... address sizes : 39 bits physical, 48 bits virtual power management: </syntaxhighlight>|root@kangjian:~#}} CPU 个数。 {{shc_out|<syntaxhighlight lang="bash"> more /proc/cpuinfo |grep "physical id"|uniq|wc -l </syntaxhighlight>|<syntaxhighlight lang="javascript"> 1 </syntaxhighlight>|root@kangjian:~#}} 线程数。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo | grep processor </syntaxhighlight>|<syntaxhighlight lang="javascript"> 12 </syntaxhighlight>|root@kangjian:~#}} {{shc_out|<syntaxhighlight lang="bash"> more /proc/cpuinfo |grep "physical id"|grep "0"|wc -l </syntaxhighlight>|<syntaxhighlight lang="javascript"> processor : 0 processor : 1 processor : 2 processor : 3 processor : 4 processor : 5 processor : 6 processor : 7 processor : 8 processor : 9 processor : 10 processor : 11 </syntaxhighlight>|root@kangjian:~#}} 物理 CPU。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l </syntaxhighlight>|<syntaxhighlight lang="javascript"> 1 </syntaxhighlight>|root@kangjian:~#}} 逻辑 CPU。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo |grep "processor"|wc -l </syntaxhighlight>|<syntaxhighlight lang="javascript"> 12 </syntaxhighlight>|root@kangjian:~#}} 核心。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo |grep "cores"|uniq </syntaxhighlight>|<syntaxhighlight lang="javascript"> cpu cores : 6 </syntaxhighlight>|root@kangjian:~#}} == cpu 温度 == <syntaxhighlight lang="Bash"> sudo apt-get install lm-sensors hddtemp sudo sensors-detect sensors</syntaxhighlight> <blockquote><pre> asus-isa-0000 Adapter: ISA adapter cpu_fan: 0 RPM acpitz-acpi-0 Adapter: ACPI interface temp1: +27.8°C (crit = +119.0°C) temp2: +29.8°C (crit = +119.0°C) amdgpu-pci-0100 Adapter: PCI adapter vddgfx: +1.00 V fan1: 1287 RPM (min = 0 RPM, max = 4100 RPM) edge: +48.0°C (crit = +94.0°C, hyst = -273.1°C) power1: 24.17 W (cap = 130.00 W) coretemp-isa-0000 Adapter: ISA adapter Package id 0: +33.0°C (high = +82.0°C, crit = +100.0°C) Core 0: +32.0°C (high = +82.0°C, crit = +100.0°C) Core 1: +33.0°C (high = +82.0°C, crit = +100.0°C) Core 2: +31.0°C (high = +82.0°C, crit = +100.0°C) Core 3: +32.0°C (high = +82.0°C, crit = +100.0°C) Core 4: +32.0°C (high = +82.0°C, crit = +100.0°C) Core 5: +31.0°C (high = +82.0°C, crit = +100.0°C) </pre></blockquote> <syntaxhighlight lang="bash"> sudo apt-get install psensor psensor</syntaxhighlight> == 其他 == {{shc_out|<syntaxhighlight lang="bash"> uname -a </syntaxhighlight>|<syntaxhighlight lang="javascript"> Linux kangjian 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux </syntaxhighlight>|root@kangjian:~#}} {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c </syntaxhighlight>|<syntaxhighlight lang="javascript"> 12 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz </syntaxhighlight>|root@kangjian:~#}} {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo | grep physical | uniq -c </syntaxhighlight>|<syntaxhighlight lang="javascript"> 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual 1 physical id : 0 1 address sizes : 39 bits physical, 48 bits virtual </syntaxhighlight>|root@kangjian:~#}} {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l </syntaxhighlight>|<syntaxhighlight lang="javascript"> 12 </syntaxhighlight>|root@kangjian:~#}} 操作系统位数。 {{shc_out|<syntaxhighlight lang="bash"> getconf LONG_BIT </syntaxhighlight>|<syntaxhighlight lang="javascript"> 64 </syntaxhighlight>|root@kangjian:~#}} == 超线程 == 如果有两个逻辑 CPU 具有相同的 <code>core id</code>,则超线程已经被打开。 {{shc_out|<syntaxhighlight lang="bash"> cat /proc/cpuinfo | grep "core id" </syntaxhighlight>|<syntaxhighlight lang="javascript"> core id : 0 core id : 1 core id : 2 core id : 3 core id : 4 core id : 5 core id : 0 core id : 1 core id : 2 core id : 3 core id : 4 core id : 5 </syntaxhighlight>|root@kangjian:~#}}
此页面嵌入的页面:
模板:Shc out
(
查看源代码
)
模板:Shc out/style.css
(
查看源代码
)
返回
Linux/CPU
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。