关于linux:Linux中一个高效的资源监控器-–-Bpytop

6次阅读

共计 1543 个字符,预计需要花费 4 分钟才能阅读完成。

对于终端爱好者来说,可能监控系统资源的应用也是至关重要的。理解零碎的资源利用率能够帮忙您在个别的系统维护中做出理智的决策。有一些选项,比方 top 和 htop,然而它们只显示一些零碎指标,比方 CPU 和内存应用状况。Bpytop 是一个高效的、视觉上很吸引人的基于终端的资源监视器。

筹备工作

在开始装置 Bpytop 之前,请确保零碎满足以下要求:

  • Python3
  • Psutil 模块。装置形式python3 -m pip install psutil

装置 Bpytop

您能够通过两种形式装置 Bpytop:从 github 下载源码包进行编译装置和从各个发行版零碎的仓库中装置。让咱们看看以下每种装置形式:

源码装置

首先须要从 github 克隆:

[root@localhost ~]# git clone https://github.com/aristocrat…
Cloning into ‘bpytop’…
remote: Enumerating objects: 121, done.
remote: Counting objects: 100% (121/121), done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 501 (delta 73), reused 95 (delta 48), pack-reused 380
Receiving objects: 100% (501/501), 765.44 KiB | 81.00 KiB/s, done.
Resolving deltas: 100% (298/298), done.


克隆实现之后,进入 bpytop 目录,并编译装置:

[root@localhost ~]# python3 -m pip install psutil
[root@localhost ~]# cd bpytop/
[root@localhost bpytop]# make install

编译装置的时候,须要装置 psutil 模块,没有装置的话,bpytop 不能启动。

psutil 模块也能够从发行版仓库中装置,例如 ubuntu 和 Centos:

# Centos8 中装置 python3-psutil
[root@localhost ~]# yum -y install python3-psutil

Ubuntu 18.04 中装置 python3-psutil

bob@ubuntu-18-04:~$ sudo apt -y install python3-psutil

装置实现。

在各个发行版中如何装置

除了从源码进行编译外,还能够按以下形式装置 Bpytop:
Ubuntu 中应用 snap 包管理器装置

bob@ubuntu-18-04:~$ sudo snap install bpytop
bpytop 1.0.22 from James Tigert (kz6fittycent) installed

Centos8 中应用 dnf/yum 包管理器装置

[root@localhost ~]# dnf -y install bpytop

FreeBSD 中应用 pkg 包管理器装置

$ sudo pkg install bpytop

启动 Bpytop

只须要在终端中输出 bpytop 就可运行:

$ bpytop


Centos8 文本模式终端中启动 Bpytop


Ubuntu 图形界面中的终端启动 Bpytop
如果想要批改主题等设置,能够按一下 ESC 键`,而后抉择`OPTIONS,而后会呈现一些选项,可供批改。应用键盘上下左右按键来批改。


如果须要提供帮忙,能够按一下 h 键 或者 ESC 键`,抉择`HELP 选项。能够关上帮忙页面。

那么如何退出 Bpytop 程序呢?只须要按一下 q 键 就能够退出。或者 ctrl + c 快捷键退出。

总结

Bpytop 的配置文件在 $HOME/.config/bpytop 中,也能够在配置文件中批改 bpytop 的主题。

正文完
 0