ssh user@server 'htop'Fast way to inspect a remote machine without a long interactive shell session.
Common htop workflows for SSH sessions, containers, services, and production troubleshooting on Linux hosts.
Run htop on servers, over SSH, and in narrow terminal environments.
ssh user@server 'htop'Fast way to inspect a remote machine without a long interactive shell session.
Keep monitoring alive if your connection drops.
ssh user@server 'tmux new-session -A -s ops htop'Great for production monitoring sessions that should survive disconnects.
sudo htopOften needed to inspect other users' processes fully or send privileged signals.
sudo htop --readonlyUseful on production systems when you want observability but not intervention from the UI.
sudo htop -u postgres -tShows process relationships for Postgres background workers and connections.
Recipe patterns for containers and system services.
Inspect the process table from the container's perspective.
docker exec -it web htopUseful for debugging entrypoints, workers, and PID 1 behavior.
Attach an interactive process view to a pod shell.
kubectl exec -it deploy/api -- htopWorks when htop is present in the container image.
Generate a PID list for one service family.
htop -p "$(pgrep -d, -f 'nginx:|nginx')"Useful when workers or master processes share a recognizable command pattern.
Sort by memory and refresh quickly.
sudo htop --sort-key=PERCENT_MEM -d 5Good first step when a server is swapping or near OOM.
sudo htop --sort-key=PERCENT_CPU -d 5Useful when bursts are too short to catch with a slower refresh interval.