温馨提示×

Debian cpuinfo怎么看

小樊
42
2026-08-06 05:45:06
栏目: 智能运维

在 Debian(以及大多数 Linux 系统)里,查看 CPU 信息最常用的是这个文件:

cat /proc/cpuinfo

常用查看方式

1️⃣ 查看完整 CPU 信息

cat /proc/cpuinfo

内容说明:

  • processor:逻辑 CPU 编号
  • model name:CPU 型号
  • cpu MHz:主频
  • cache size:缓存大小
  • flags:支持的 CPU 特性(如 AVX、VT-x 等)

2️⃣ 只看 CPU 型号

grep "model name" /proc/cpuinfo | head -1

3️⃣ 查看 CPU 核心数(逻辑 / 物理)

逻辑 CPU 数量

nproc

grep -c processor /proc/cpuinfo

物理 CPU 数量

grep "physical id" /proc/cpuinfo | sort -u | wc -l

每个物理 CPU 的核数

grep "cpu cores" /proc/cpuinfo | uniq

4️⃣ 更直观的工具(推荐)

lscpu(最常用)

lscpu

示例输出:

Architecture:        x86_64
CPU(s):              8
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           1
Model name:          Intel(R) Core(TM) i7-xxxx

5️⃣ 查看 CPU 是否支持虚拟化

egrep -c '(vmx|svm)' /proc/cpuinfo
  • 返回值 > 0:支持虚拟化(Intel vmx / AMD svm)

6️⃣ 查看实时 CPU 使用情况

top

htop

(htop 更友好,需安装:sudo apt install htop


总结

需求 命令
查看 CPU 信息 cat /proc/cpuinfo
快速概览 lscpu
逻辑 CPU 数 nproc
是否支持虚拟化 `egrep '(vmx

如果你是想 判断云服务器配置、CPU 是否真实、是否超卖,我也可以帮你分析输出内容。

0