在 Debian 里,cpustat 通常不是系统默认自带的命令,它来自一个叫 cpustat 的小工具(作者是 Colin Ian King,也是 stress-ng 的作者)。
which cpustat
或
command -v cpustat
如果没有输出,说明确实没装。
在 Debian 10+(buster 及以后)的官方仓库里就有:
sudo apt update
sudo apt install cpustat
安装完后:
cpustat
安装后一般在:
/usr/bin/cpustat
你可以用:
dpkg -L cpustat
查看它安装的所有文件。
有时用户其实想要的是:
mpstat(来自 sysstat)sudo apt install sysstat
mpstat 1
top / htop/proc/statsarsudo apt install cpustat
/usr/bin/cpustat如果你是想“在源码里找”或“写脚本调用 cpustat”,也可以告诉我具体用途。