温馨提示×

cpustat在debian在哪

小樊
47
2026-09-10 14:42:20
栏目: 智能运维

在 Debian 里,cpustat 通常不是系统默认自带的命令,它来自一个叫 cpustat 的小工具(作者是 Colin Ian King,也是 stress-ng 的作者)。

1. 先确认命令是否存在

which cpustat

command -v cpustat

如果没有输出,说明确实没装。


2. 在 Debian 上安装 cpustat

Debian 10+(buster 及以后)的官方仓库里就有:

sudo apt update
sudo apt install cpustat

安装完后:

cpustat

3. cpustat 在哪个路径

安装后一般在:

/usr/bin/cpustat

你可以用:

dpkg -L cpustat

查看它安装的所有文件。


4. 如果你说的是“系统自带但名字像 cpustat 的工具”

有时用户其实想要的是:

  • mpstat(来自 sysstat
    sudo apt install sysstat
    mpstat 1
    
  • top / htop
  • /proc/stat
  • sar

总结

  • Debian 官方源里有 cpustat
  • 安装命令:
    sudo apt install cpustat
    
  • 路径通常是 /usr/bin/cpustat

如果你是想“在源码里找”或“写脚本调用 cpustat”,也可以告诉我具体用途。

0