Most people familiar with Linux have used the top command line utility to see what process is taking the most CPU or memory. There’s a similar utility called htop that is much easier to use for normal tasks.
大多数熟悉Linux的人都使用top命令行实用程序来查看哪个进程占用了最多的CPU或内存。 有一个类似的实用程序称为htop,它可以更轻松地用于正常任务。
The first great thing about htop is that it will show you your usage per CPU, as well as a meaningful text graph of your memory and swap usage right at the top. I find this much easier to understand at a glance than the default output from top.
关于htop的第一件事是,它将在顶部显示您每个CPU的使用情况,以及有意义的内存和交换使用情况文本图。 我发现这比顶部的默认输出一目了然。
Installing htop on Ubuntu
在Ubuntu上安装htop
Installing on Ubuntu is as simple as apt-get… You can also grab the source from the htop site linked at the bottom of this article.
在Ubuntu上安装就像apt-get一样简单。您也可以从本文底部链接的htop站点获取源代码。
sudo apt-get install htop
sudo apt-get install htop
Once installed, just type htop at a terminal to launch it, and notice the great text-mode graph at the top of the display:
安装完成后,只需在终端上键入htop即可启动它,并注意显示屏顶部的文字模式图:
But here’s the best part… just use your Up/Down arrow keys to select a process, and then you can kill it with the F9 key if you’d like, or you can change the priority by using the F7 and F8 keys. (note that you’ll have to be root to give anything really high priority).
但这是最好的部分……只需使用向上/向下箭头键选择一个进程,然后即可根据需要使用F9键取消它,或者可以使用F7和F8键更改优先级。 (请注意,您必须具有超级用户权限才能给予任何真正高优先级的权限)。
You can also use the F6 key to change the default sort column really easily:
您还可以使用F6键非常轻松地更改默认的排序列:
You can check the setup options for a lot more settings like which columns should show up by default.
您可以检查设置选项以了解更多设置,例如默认情况下应显示哪些列。
htop – process viewer for linux
翻译自: https://www.howtogeek.com/howto/ubuntu/using-htop-to-monitor-system-processes-on-linux/