在 Debian(以及其他 Linux 发行版)中,查看 CPU 信息常用以下几种方法:
/proc/cpuinfocat /proc/cpuinfo
常见查看方式:
# 查看逻辑 CPU 数量
grep -c processor /proc/cpuinfo
# 查看物理 CPU 个数
grep "physical id" /proc/cpuinfo | sort -u | wc -l
# 查看 CPU 型号
grep "model name" /proc/cpuinfo | uniq
lscpu 命令(推荐)lscpu
会显示:
nprocnproc
只显示可用的逻辑 CPU 数量。
lshw(需安装)sudo apt install lshw
lshw -C cpu
watch -n 1 "cat /proc/cpuinfo | grep MHz"
如果你是想知道 CPU 占用情况,可以用:
top
# 或
htop
(htop 需安装:sudo apt install htop)
如果你是特定想看某类信息(比如是否支持虚拟化、CPU 温度等),可以告诉我。