Linux htop 系統監控

Linux htop 系統監控取代 top 指令

Last Updated on October 21, 2022


Linux 的 htop 用來查看伺服器的系統狀態工具,會比 top 來的清楚,不過 htop 不是 Linux 內建的程式,需要額外安裝。

htop

安裝方法:

centos 系統

yum install htop

debian / ubuntu 系統

apt-get install htop

如果源裡沒有,可以自行編譯安裝:

wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
tar xvfz ncurses-5.9.tar.gz
cd ncurses-5.9
./configure
make
make install

wget http://sourceforge.net/projects/htop/files/htop/0.9/htop-0.9.tar.gz
tar zxvf htop-0.9.tar.gz
cd htop-0.9
./configure
make
make install

使用 top 查看系統:

Linux top

使用 htop 查看系統,是不是比較清楚了:

Linux htop

執行 htop 後,還有幾個選項可以操作:

  • F2:進行參數設定,可以自定義選項
  • F3:搜尋你想要看的 process 狀態,輸入進程的名字然後 Enter 搜尋
  • F5:進行樹狀排序,這樣你就可以清楚知道那個 child 是由那個 parent 所 fork 出來的
  • F6:排序
  • F10:離開

後記

這是一篇舊文章,是從我之前的 blog 搬過來的文章

Photo by Gabriel Heinzer on Unsplash


Share your thoughts