Skip to content

Acting on a Process

Outcome: you can stop a process from inside btop — politely first, forcefully if it refuses — and you understand the one safeguard btop gives you, because this guide's lab nearly stopped the wrong process and was saved by reading it.

Signals, in plain words

Unix processes are stopped by signals: numbered messages the system delivers. Two matter daily. SIGTERM (15) is a request — please finish and exit — and a well-behaved program tidies up and dies. SIGKILL (9) is not a request: the system ends the process on the spot, with no chance to save anything. The standing rule follows from that: TERM first, wait, and let KILL be the answer to a process that ignored you, never the opening move. The footer's other buttons live nearby: signals opens the full numbered list for the rarer messages, and Nice adjusts a process's priority — how eagerly the processor serves it — which is a nudge, not a stop.

In btop, with a row selected, t terminates (SIGTERM) and k kills (SIGKILL).

The confirmation, and why it exists

Neither key acts at once. Both first raise a popup that names the signal, the number, and — in words — the exact target. The lab's own stop, of its runaway busy loop, read:

 │            Send signal: 15 (SIGTERM)
 │          To PID: 68456 (press-worker)
 │
 │           ╭───────────╮  ╭──────────╮
 │           │    Yes    │  │    No    │

Read that middle line every time. PIDs are how the machine tells processes apart, and two processes with similar names are different processes. The lab learned this in its first attempt: it selected a row, pressed t, and the popup announced a target of PID 68654 (zig) — a compiler belonging to other work on the same machine, which had floated into the selected row as the live list re-sorted itself between the key presses. The lab pressed Escape, nobody's compile was harmed, and the retry was done the careful way: filter the list down to the one intended process first (chapter 4), so there is exactly one row it can mean, then t, then read the popup, then Yes.

That is the whole technique, and it is not ceremony: a list that re-sorts twice a second makes "the row I was looking at" a moving target, and the popup is the one moment the machine tells you what you are actually about to do.

After Yes

The lab confirmed, and press-worker was gone from the list at the next refresh. Do not take btop's word alone for a stop that matters — check with a second tool, as the lab did:

ps -p 68456

which answered with only its header line: no such process. The machine agreed, and its processor graph fell back to ordinary levels within a refresh or two.

Three cautions complete the chapter. Stopping a child whose parent is a supervisor (a service manager, a build tool, another program that restarts its helpers) often achieves nothing: the parent starts a fresh copy, and the tree view (chapter 4) is how you spot that family before acting. Stopping processes owned by other users, or by the system itself, needs administrator rights, and btop will simply fail to deliver the signal without them — run as root, conversely, it can stop anything, including processes the machine needs to stay alive, which is why this guide's lab ran as an ordinary user and signalled only processes it had started itself. And a process in the middle of writing a file, given KILL, leaves the file as it was mid-sentence: one more reason TERM, and patience, come first.

Check: start something harmless of your own (a sleep 600), find it in btop, press t, read the popup's PID line against the list, confirm — and verify with ps that it is gone.