What is a PID
A PID (process ID) is a unique integer the operating system assigns to every running process. When you type kill 1234, the number 1234 is a PID. It is how the OS — and you — refer to a specific process.
How it works
When a process is created, the kernel assigns it the next available PID. PIDs are typically positive integers starting from 1 and incrementing. When a process exits, its PID eventually becomes available for reuse, though most systems cycle through a large range (up to 4,194,304 on modern Linux) before recycling.
PID 1 is special. On a Linux system, PID 1 is the init process — the first process started by the kernel after boot. It is the ancestor of every other process and has a unique responsibility: if a child process's parent exits first, that orphan is adopted by PID 1, which must call wait to clean up its exit status. If PID 1 crashes, the kernel panics.
Every process also has a PPID (parent process ID) — the PID of the process that created it. This parent-child relationship forms a tree. You can see it with ps --forest or pstree.
PID namespaces allow a process to think it is PID 1 within its own isolated view, while the host sees it as a regular PID. This is fundamental to how containers work — the container's init process believes it is PID 1, but the host kernel tracks it with a different number.
Why it matters
PIDs are the handle you use to interact with processes. Sending a signal requires a PID. Checking if a process is alive requires a PID. Debugging a misbehaving service starts with finding its PID. And PID namespaces are one of the key building blocks that make containers possible — giving each container its own isolated process tree.
See How Processes Work for the full process lifecycle.