LINUX / A CONCEPT NOTE

Processes & Signals

how programs live and die

~65 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

A process is a running instance of a program with its own PID, memory space, and file descriptors. Signals are asynchronous notifications sent to processes to trigger actions like termination.

02 / FOLLOW THE MECHANISM

How a process responds to signals

  1. Trigger

    user or system sends a signal (e.g., kill -15 PID).

  2. Signal Dispatch

    kernel halts process execution and transfers control to the signal handler.

  3. Handler Action

    process either intercepts the signal (SIGTERM) to clean up, or gets terminated instantly by kernel (SIGKILL).

  4. Exit status

    parent process reaps the exit code using wait() to avoid leaving a zombie process.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

find the process IDs (PIDs) of running apps

ps aux | grep nginx

EXAMPLE 02 · REFERENCE

force kill a process instantly

kill -9 PID

Explore command anatomy in the CLI lab