Linux查看系统硬件信息 CPU

1. CPU

# 查看 cpu 的统计信息
$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                64
On-line CPU(s) list:   0-63
Thread(s) per core:    2
Core(s) per socket:    16
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
Stepping:              7
CPU MHz:               2294.616
BogoMIPS:              4594.28
......

# /proc/cpuinfo 包含 cpu 的详细信息,如型号、主频等
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz
stepping        : 7
microcode       : 0x5002f01
cpu MHz         : 2294.616
cache size      : 22528 KB
......

# 查看 cpu 型号
$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
     64  Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz

# 查看 cpu 数量
$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
2

# 查看每个 cpu 的核心数
$ cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores       : 16

# 查看每个核心的线程数
$ cat /proc/cpuinfo | grep "processor" | wc -l
64
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《Linux查看系统硬件信息 CPU》
文章链接:https://zhuji.vsping.com/3444.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。