top

top- display Linux processes

The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for processes are all user configurable and that configuration can be made per‐sistent across restarts.
The program provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration -- encompassing every aspect of its operation. And while top is referred to throughout this document,you are free to name the program anything you wish. That new name, possibly an alias, will then be reflected on top's display and used when reading and writing a configuration file.

top基本视图

  • 第1行:
  • 第2行:
  • 第3行:
  • 第4-5行:
  • 进程:
    通过top命令进入基本视图,默认情况下,各进程按CPU占用情况来排序,如下图中,进程id为980的teamviewerd进程排在第一(CPU占用4%),进程id为11996的teamviewerd进程排在第一(CPU占用4%)。

top常用交互命令

帮助命令

h或?

打开/关闭加亮效果

- 敲击键盘b,top视图变化如下:


可以通过敲击y键关闭或打开运行态进程的加亮效果。
- 敲击键盘x(打开或关闭排序列的加亮效果),top视图变化如下:

可以看到,默认的排序是按CPU的占用情况降序排列。

改变排序列,可以通过shift+>和shift+<改变排序列,下图是按shift+>后的效果图:

改变进程显示字段

敲击f键,top进入另一个视图,在这里可以编排基本视图中的显示字段:

这里列出了所有可在top基本视图中显示的进程字段,有并且标注为大写字母的字段是可显示的,没有并且是小写字母的字段是不显示的。按提示进行相应的操作,隐藏或显示某些列,以增加CODE和DATA列为例:

按Enter键返回到基本视图后,发现多了CODE和DATA这2列:

显示多个CPU

数字键:1 2 3 4

持续更新......

参考链接:
https://www.cnblogs.com/bolwing-1991/p/3557287.html
https://www.cnblogs.com/zhoug2020/p/6336453.html





posted @ 2019-02-18 15:21  whatislinux  阅读(267)  评论(0编辑  收藏  举报