はじめに

Homebrewで入れておくと便利なものないかなと調べてみたところ、下記のGitHubリポジトリを見つけた。 https://github.com/fwcd/brew-pkgs?tab=readme-ov-file この中に、htopという面白そうなコマンドを入れていたので使ってみる。

環境

1
Mac OS Sonoma 14.2.1

インストール

https://formulae.brew.sh/formula/htop

1
brew install htop
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
brew install htop
==> Downloading https://ghcr.io/v2/homebrew/core/htop/manifests/3.3.0
################################################################################################################################################################# 100.0%
==> Fetching htop
==> Downloading https://ghcr.io/v2/homebrew/core/htop/blobs/sha256:5cd79199db8d7394d331dbb362dd101d12519325f78dde1af4e7c67fb9f4e5da
################################################################################################################################################################# 100.0%
==> Pouring htop--3.3.0.sonoma.bottle.tar.gz
==> Caveats
htop requires root privileges to correctly display all running processes,
so you will need to run `sudo htop`.
You should be certain that you trust any software you grant root privileges.
==> Summary
🍺  /usr/local/Cellar/htop/3.3.0: 12 files, 352.9KB
==> Running `brew cleanup htop`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

使ってみる

1
htop

※一部のみ切り取っている。

下の方にメニューがあり、これらでプロセスの検索、フィルター、ツリー表示、ソート、プロセスのキルなどなどできる。

ビジュアライズされているのでみていて面白い。

おわりに

プロセスの調査では、psとかあとはtopを使うのが十八番だが、htopも中々に良さそう。
ただ、サーバでの調査というよりかは開発用マシンに入れるものかなと思う。
サーバの方では最小限のインストールで済ませたいのと、topコマンドも十分なので。