TerminalSkills/skills

htop

htop is an interactive process viewer for Linux, macOS and BSD that shows CPU, memory and per-process usage live, with filtering, tree view and kill/renice from the keyboard.

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/TerminalSkills/skills --skill htop

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

htop / System Monitoring

Overview

htop is an interactive, ncurses-based process viewer (current release 3.5.3, August 2026). It runs on Linux, macOS, FreeBSD and other Unixes, needs no agent, and lets you sort, filter, tree-view, trace and signal processes without typing PIDs. Combined with free, vmstat, iostat, ss and friends it covers most live "why is this box slow" questions.

Install it from the system package manager: sudo apt install htop, sudo dnf install htop, brew install htop, sudo pacman -S htop.

Instructions

Step 1: Process monitoring

bash
htop                          # interactive viewer
htop -u deploy                # only processes of user "deploy" (plain -u means yourself)
htop -p 1234,5678             # only these PIDs
htop -F nginx                 # filter by command text; "nginx|php-fpm" matches either
htop -s PERCENT_MEM           # start sorted by memory (-s help lists the columns)
htop -t                       # start in tree view
htop -d 20 -H                 # refresh every 2 s (delay is in tenths of a second), highlight new processes
htop --readonly               # look but cannot kill or renice (safe on shared hosts)

Keys inside htop:

KeyAction
F5 or ttree view (toggle)
F6 or < >choose sort column; I inverts; P CPU, M memory, T time, N PID
F3 or /search the command lines; F3 again for the next match
F4 or \filter the list to matching commands (Esc in the filter to clear)
ushow one user's processes
Space, ctag a process; c tags it with its children; U untags all
F9 or ksend a signal to the selected or tagged processes (pick SIGTERM first)
F7 / F8lower / raise nice value (lowering needs root)
s, lstrace and lsof of the selected process, when those tools are installed
Ffollow the selected process as the sort order moves it
K, Hhide kernel threads, hide user threads
F2setup: meters, columns, colour scheme (saved in ~/.config/htop/htoprc)

Reading the screen: the S column shows R running, S sleeping, D uninterruptible disk wait (many of these means an I/O stall), Z zombie. RES is real memory used, VIRT is address space and is usually meaningless on its own, SHR is shared.

Step 2: Resource analysis

bash
# CPU and memory overview (Linux)
free -h                    # memory; read the "available" column
uptime                     # load average for 1, 5 and 15 minutes
nproc                      # number of CPU cores
vmstat 1 5                 # run queue, swap in/out (si/so), I/O wait (wa), 5 samples

# Disk I/O (iostat comes from the sysstat package)
iostat -x 1                # per-device utilisation and latency
sudo iotop -o              # only processes doing I/O right now (needs root)

# Network
sudo nethogs               # bandwidth per process (needs root)
sudo iftop                 # bandwidth per connection (needs root)
ss -tlnp                   # listening TCP sockets with owning process
ss -ulnp                   # listening UDP sockets

On macOS use sysctl -n hw.ncpu, vm_stat and iostat -w 1; free, nproc, iotop and ps --sort are Linux (procps) tools.

Step 3: Quick diagnostics script

bash
#!/bin/bash
# scripts/server-status.sh — quick health check on Linux
echo "=== CPU load ($(nproc) cores) ==="
uptime

echo -e "\n=== Memory ==="
free -h

echo -e "\n=== Disk ==="
df -h /

echo -e "\n=== Top 5 CPU processes ==="
ps aux --sort=-%cpu | head -6

echo -e "\n=== Top 5 memory processes ==="
ps aux --sort=-%mem | head -6

echo -e "\n=== Listening sockets ==="
ss -tulnp

Examples

"The server is slow, what is eating the CPU?" Run htop, press P to sort by CPU, and look at the top rows. Compare the load average in the header with the core count (nproc). If one row sits at 100% CPU, press F9 and choose SIGTERM (15) first; use SIGKILL (9) only if it ignores that. For a process that is a child of a supervisor, press F5 first to see which parent will respawn it.

"Memory is almost full, which service leaks?" Run free -h and check that "available" is low, not just "free". Then htop -s PERCENT_MEM (or press M) and watch the RES column over a few minutes; a process whose RES only grows is the suspect. Press F to keep it selected while the list reshuffles.

"Find everything my deploy user runs that is related to node." htop -u deploy -F node, then F5 for the tree. Tag the stale ones with Space and kill them together with F9.

Guidelines

  • A load average above the number of cores means runnable or blocked tasks are queuing; if CPU is idle but load is high, look for D states and I/O wait (vmstat, iostat -x).
  • In free -h read "available", not "free": Linux uses spare RAM as cache.
  • Do not trust VIRT; use RES or the PSS column (add it in F2 setup) to compare processes.
  • htop shows other users' processes but kill, renice and some columns (such as EXE) need root or matching privileges. Prefer --readonly when you only want to look.
  • Check the process and its parent before sending a signal; killing a worker that a supervisor restarts changes nothing.
  • htop is a live view. For history pair it with Prometheus and Grafana or Netdata; for a single snapshot use ps. btop is a similar viewer with disk and network panels.
from this repository

More skills

All skills
TerminalSkills
Community

3dsmax-rendering

Scripts and configures production rendering in Autodesk 3ds Max with the V-Ray and Corona renderers: output size and files, render elements, denoising, light mix, batch and command-line rendering, and network rendering. Use when a user asks to set up a production render, render several cameras in one batch, render from the command line or on a render farm, add render passes for compositing, or cut render time for archviz and product shots.

installs
0
GitHub stars
180
Updated
Oct 25
TerminalSkills
Community

3dsmax-scripting

Covers scripting Autodesk 3ds Max, the 3D modeling and rendering application, with MAXScript and Python (pymxs): scene manipulation, object creation, material assignment, camera and light setup, batch operations, and file I/O. Use when tasks involve automating repetitive 3ds Max workflows, batch processing scenes, running scripts headless with 3dsmaxbatch, creating custom tools, or scripting scene setup for archviz, product visualization, or VFX.

installs
0
GitHub stars
180
Updated
Oct 25
TerminalSkills
Community

3proxy

3proxy is a small open-source proxy server that runs HTTP/HTTPS, SOCKS4/5, SNI and TCP/UDP port-mapping proxies from one config file. Use when a user asks to set up an HTTP or SOCKS5 proxy, add proxy users and passwords, write 3proxy access rules, chain or rotate upstream (parent) proxies, limit bandwidth, connections or monthly traffic per user, run 3proxy in Docker, or fix a 3proxy.cfg that will not start.

installs
0
GitHub stars
180
Updated
Oct 25
TerminalSkills
Community

a2a-protocol

Builds Agent2Agent (A2A) servers and clients, the open protocol (originally from Google, now under the Linux Foundation) that lets AI agents from different frameworks call each other. Use when the user wants to create an A2A-compliant agent, build an Agent Card, implement task management, connect agents across frameworks, set up agent discovery, handle streaming responses, implement push notifications, or orchestrate multi-agent workflows. Trigger words: a2a, agent to agent, agent2agent, a2a pro

installs
0
GitHub stars
180
Updated
Oct 25