使用BashTop,您还可以对进程进行排序,以及轻松地在各种排序选项之间切换。此外,您可以将SIGKILL,SIGTERM和SIGINT发送到所需的进程。

BashTop可以安装在Linux,macOS甚至FreeBSD上。在本文中,您将学习如何在CentOS发行版上安装BashTop。

请输入图片描述

它带有游戏风格的响应式终端UI和可自定义的菜单。各种显示部分的整齐排列使监视各种系统指标变得容易。BashTop是Linux中基于终端的资源监控实用程序。它是一个漂亮的命令行工具,可以直观地显示CPU、内存、正在运行的进程和带宽的统计数据。

手动安装

要手动安装BashTop,请如下所示克隆git仓库,并使用以下命令从源代码编译:

$ git clone https://github.com/aristocratos/bashtop.git
$ cd bashtop
$ make install

要卸载BashTop,请运行:

$ make uninstall

BashTop配置

BashTop的配置文件位于 ~/.config/bashtop/bashtop.cfg 位置。您可以根据需要更改参数,以自定义终端上指标的外观和输出。

下面是配置文件内容:

#? Config file for bashtop v. 0.9.25
#* Color theme, looks for a .theme file in "HOME/.config/bashtop/themes" and "HOME/.config/bashtop/themes"and"HOME/.config/bashtop/user_themes"
#* Should be prefixed with either "themes/" or "user_themes/" depending on location, "Default" for builtin default theme
color_theme="Default"
#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs
update_ms="2500"
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive"
#* "cpu lazy" updates sorting over time, "cpu responsive" updates sorting directly
proc_sorting="cpu lazy"
#* Reverse sorting order, "true" or "false"
proc_reversed="false"
#* Show processes as a tree
proc_tree="false"
#* Check cpu temperature, only works if "sensors", "vcgencmd" or "osx-cpu-temp" commands is available
check_temp="false"
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable
draw_clock="%X"
#* Update main ui when menus are showing, set this to false if the menus is flickering too much for comfort
background_update="true"
#* Custom cpu model name, empty string to disable
custom_cpu_name=""
#* Enable error logging to "$HOME/.config/bashtop/error.log", "true" or "false"
error_logging="true"
#* Show color gradient in process list, "true" or "false"
proc_gradient="true"
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power
proc_per_core="false"
#* Optional filter for shown disks, should be names of mountpoints, "root" replaces "/", separate multiple values with space
disks_filter=""
#* Enable check for new version from github.com/aristocratos/bashtop at start
update_check="true"
#* Enable graphs with double the horizontal resolution, increases cpu usage
hires_graphs="false"
#* Enable the use of psutil python3 module for data collection, default on OSX
use_psutil="false"

若要查看命令和快捷键,请按Esc键,然后使用向下箭头键选择Help选项。

这将打印出下面的菜单和所有命令选项,如图所示。

请输入图片描述

总结

BashTop的界面可以说是非常的华丽,用来在同事和老板面前装逼绝对是够用了。不过就是因为界面华丽所以相对于Top和Htop来说慢了不少,毕竟占用资源过多嘛!就明月自己的体验来说BashTop显示的指标还是很全面的比较适合新手使用,一句话“装逼神器”呀这是!嘿嘿!

最后修改:2020 年 08 月 13 日
如果觉得我的文章对你有用,请随意赞赏