在Linux中使用Bashtop与Bpytop监管系统资源( 二 )

在Linux中使用Bashtop和Bpytop监管系统资源如前所述,Bashtop和Bpytop的作用是相同的,即监视系统资源并显示CPU、内存、磁盘、进程和网络等的统计数据 。
要开始监控你的Linux系统资源,运行Bashtop或Bpytop,如下所示:
$ bashtop或者,
$ bpytop输出示例:

在Linux中使用Bashtop与Bpytop监管系统资源

文章插图
在Linux中使用Bashtop监视系统资源
正如你在上面的输出中看到的,Bashtop显示了以下细节:
  • CPU使用率
  • 处理器时钟速度
  • CPU总使用率
  • 每个CPU核心的使用情况
  • 总内存
  • 已使用内存
  • 空闲内存
  • 高速缓存
  • 可用高速缓存
  • 交换空间使用率(已使用和空闲)
  • 磁盘的当前读取和写入速度
Bashtop/Bpytop的默认刷新速率是2500毫秒 。按(+,A, a)键可以向更新计时器添加100ms的时间 。按(-,S, s)键可以从更新计时器中减去100ms 。
选择和查看进程使用向上/向下键浏览进程或使用情况 。按向上翻页和向下翻页可以在进程列表中进行翻页 。按(Home或End)键跳转到进程列表的第一页或最后一页 。
进程部分以列的方式显示以下详细信息:
  • 进程ID (PID)
  • 进程名称
  • 参数
  • 线程
  • 进程的所有者
  • 进程的内存使用细节
  • 进程的CPU使用情况
您可以使用(左或右)箭头键在列之间切换 。
进程名按PID降序排列 。也就是说,最大的PID将显示在顶部 。您可以使用(R, r)键来逆转进程部分的排序顺序 。
要显示所选进程的详细信息,请按回车键 。
在Linux中使用Bashtop与Bpytop监管系统资源

文章插图
在Bashtop中查看所选进程的详细信息
要关闭选定的进程的详细信息框,请按ENTER键 。
过滤进程要按特定字符串过滤进程,按(F, f)键并键入字符串 。例如,如果您键入"ssh",您将看到所有以"ssh"字母开头的进程 。
在Linux中使用Bashtop与Bpytop监管系统资源

文章插图
在Bashtop中通过特定字符串过滤进程
要清除任何输入的过滤器,按(C, c)键 。
终止进程您可以通过按(T, t)键来使用SIGTERM终止所选进程 。
在Linux中使用Bashtop与Bpytop监管系统资源

文章插图
终止Bashtop中的进程
杀死进程按(K, k)键,用SIGKILL杀死选中的进程 。
这等同于“kill -9 <pid>”命令 。
中断进程要用SIGINT中断所选进程,按(I, i)键 。
显示帮助您可以键入F1、H、H键来显示帮助内容 。
在Linux中使用Bashtop与Bpytop监管系统资源

文章插图
显示Bashtop帮助内容
你可以按Esc, M, M键打开Bashtop/Bpytop主菜单 。
退出Bashtop / Bpytop要退出Bashtop/Bpytop,只需按(Ctrl-C, Q, q)键 。
配置Bashtop / BpytopBashtop and Bpytop config files are stored in "$HOME/.config/bashtop" and "$HOME/.config/bpytop" folders respectively.
Bashtop和Bpytop配置文件存储在"$HOME/中 。配置/ bashtop“ *和”$ HOME / 。分别配置/ bpytop“文件夹中 。
您可以通过查看当前的配置文件来获取Bashtop/Bpytop的配置选项 。
Bashtop配置文件:
$ cat ~/.config/bashtop/bashtop.cfgBpytop配置文件:
$ cat ~/.config/bashtop/bpytop.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/user_themes"#* Should be prefixed with either "themes/" or "user_themes/" depending on location, "Default" for builtin default themecolor_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 graphsupdate_ms="2300"?#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive"#* "cpu lazy" updates sorting over time, "cpu responsive" updates sorting directlyproc_sorting="pid"?#* Reverse sorting order, "true" or "false"proc_reversed="false"?#* Show processes as a treeproc_tree="false"?#* Check cpu temperature, only works if "sensors", "vcgencmd" or "osx-cpu-temp" commands is availablecheck_temp="false"?#* Draw a clock at top of screen, formatting according to strftime, empty string to disabledraw_clock="%X"?#* Update main ui when menus are showing, set this to false if the menus is flickering too much for comfortbackground_update="true"?#* Custom cpu model name, empty string to disablecustom_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 powerproc_per_core="false"?#* Optional filter for shown disks, should be names of mountpoints, "root" replaces "/", separate multiple values with spacedisks_filter=""?#* Enable check for new version from github.com/aristocratos/bashtop at startupdate_check="true"?#* Enable graphs with double the horizontal resolution, increases cpu usagehires_graphs="false"?#* Enable the use of psutil python3 module for data collection, default on OSXuse_psutil="true"


推荐阅读