Linux htop 系統監控取代 top 指令

·

Linux htop

Unsplash+

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 htop

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

Linux htop

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

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

參考資料:

https://linuxopsys.com/topics/linux-htop-things-you-should-know

hosted by kinsta

Comments

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Hey, 想嘗試 Kinsta 主機嗎?

18748

Kinsta 高效能主機

wPowered Starter 方案

馬上訂購

18749
Your Mastodon Instance