Linux5h estimated

Processes in Practice

Difficulty
Importance

The problem

Running programs need to be inspected, controlled, and sometimes forcibly stopped from the shell — without practical tools to list, signal, and manage processes, a hung or runaway program can only be fixed by rebooting the entire machine.

Why now

Processes and threads, and system calls and the kernel, already covered what a process is and how it talks to the kernel; this topic is the practical, hands-on application of that theory — the actual commands used to observe and control the processes those earlier topics only described abstractly.

Mental model

Every running process has a PID (a simple integer identity) and a state (running, sleeping, stopped). ps and top let you look at that state; kill doesn't actually 'kill' by force — it sends a signal (a simple, standardized interrupt message) that the target process can catch, ignore, or die from, which is why some processes need SIGKILL instead of the gentler SIGTERM to actually stop.

Requires

Used in

Projects

  • Start a long-running background process, find its PID with ps, and terminate it with kill, observing the difference between SIGTERM and SIGKILL
  • Use top or htop to identify the most CPU- and memory-intensive processes currently running on your machine

Examples

  • kill -9 <pid> sends SIGKILL, an unignorable signal that terminates a process immediately without cleanup
  • A well-behaved server catches SIGTERM to finish in-flight requests before shutting down, rather than dying mid-request

Resources

Mastery checklist