温馨提示×

ubuntu cpustat在哪打开

小樊
37
2026-10-12 16:38:29
栏目: 智能运维

在 Ubuntu 里,cpustat 不是一个默认就装好的命令,它通常来自 sysstat 工具包,或者是 perf-tools / cpustat 这类工具。下面分情况说:


一、你指的是 mpstat / sar(sysstat 里的 CPU 统计)

这是最常见的“cpustat”类工具。

1. 安装

sudo apt update
sudo apt install sysstat

2. 打开 / 使用

mpstat
mpstat 1
sar -u 1
  • mpstat:查看 CPU 使用率
  • sar -u:历史/实时 CPU 统计

二、你指的是 cpustat(来自 perf-tools)

这是 Brendan Gregg 写的工具,用来按进程看 CPU 占用。

1. 安装

sudo apt install cpustat

或手动:

git clone https://github.com/brendangregg/perf-tools

2. 使用

sudo cpustat
sudo cpustat 1

⚠️ 通常需要 root 权限


三、你只是想“打开一个 CPU 监控界面”

可以用这些:

htop
top
nmon

安装:

sudo apt install htop nmon

四、简单判断你现在有没有

which cpustat
which mpstat

如果你能告诉我:

  • 是 命令行 还是 图形界面
  • 想看 整体 CPU 还是 某个进程

我可以给你更精确的命令。

0 踩