C.W.K.
Stream
Lesson 02 of 10 · published

top, htop, btop

~8 min · top, htop, btop, monitor

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Live processes, refreshing on screen

ps gives a snapshot. top and friends give a live view with sortable columns and quick keys to kill or renice processes.

top (built-in)

Run top. Inside: q to quit, ? for help, k + PID to kill, P sort by CPU, M sort by memory. macOS top is BSD-flavored; some keys differ from Linux top — read the inline help.

htop — friendlier UI

brew install htop. Color, mouse support, tree view (F5), filter (F4), kill menu (F9). Same data, much easier to drive. The default for most engineers.

btop — modern eye-candy

brew install btop. CPU/memory/disk/network graphs side by side. Pretty and informative; some find it slower than htop on lots of processes. Worth trying once.

Specialized monitors

  • nvtop — GPU usage (Linux/Nvidia).
  • iftop — network per-connection.
  • iotop — disk I/O per process (Linux).

Code

Set up the modern monitor stack·bash
brew install htop btop
htop
# Try mouse + F4 (filter) + F5 (tree) + F9 (kill menu)
btop

External links

Exercise

Install htop. Run it. Press F4 and filter to your shell name. Press F5 to see tree view. Press F9 to bring up the kill menu (don't actually kill anything important).

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.