cpustat
是一个用于显示 CPU 使用情况的工具,它通常包含在 sysstat
软件包中。然而,cpustat
本身并不直接提供 CPU 温度的信息。要查看 CPU 温度,你需要使用其他工具或命令。
以下是一些常用的方法来查看 CPU 温度:
sensors
命令安装 lm-sensors
(如果尚未安装):
sudo apt-get install lm-sensors # Debian/Ubuntu
sudo yum install lm-sensors # CentOS/RHEL
sudo dnf install lm-sensors # Fedora
运行 sensors-detect
来检测传感器:
sudo sensors-detect
按照提示操作,通常选择“yes”以启用所有检测到的传感器。
查看 CPU 温度:
sensors
这将显示所有传感器的详细信息,包括 CPU 温度。
lm-sensors
和 watch
命令实时监控你可以结合 watch
命令来实时监控 CPU 温度:
watch -n 1 sensors | grep 'temp'
这会每秒刷新一次 CPU 温度信息。
htop
或 top
结合 sensors
如果你更喜欢使用 htop
或 top
来查看系统资源使用情况,可以同时运行 sensors
命令来查看温度:
htop && sensors
或者
top && sensors
通过这些方法,你应该能够轻松地查看和管理你的 CPU 温度。