Frequently Asked Question

What is a PID and what is a PPID?

A PID (process ID) is the integer the kernel assigns to a process when it is created. PIDs are unique while the process is alive and are handed out roughly in order, wrapping around at the value in /proc/sys/kernel/pid_max (32 768 by default on 32-bit systems, four million on most 64-bit ones). Once a process exits and is reaped, its PID becomes available for reuse.

Every process also has a PPID, the PID of its parent, the process that called fork() to create it. From inside a shell you can see both with echo $$ (your shell's PID) and echo $PPID (its parent's). PPIDs make the process tree navigable: pstree, ps -ejH, and ps auxf all walk the parent links to draw the hierarchy. If a process's original parent dies, its PPID is rewritten to PID 1 (or to a subreaper), so every running process always has a live parent.

Further reading and video