whatis pid

PID (Process ID)

Also known as: process ID, PPID

The unique number the kernel assigns to each running process, used to inspect, signal, or kill it.

What Is a PID (Process ID) in Linux?

PIDs are handed out sequentially and reused after processes exit. PID 1 is the init system, the ancestor of every user-space process. The PPID is the parent's PID.

pgrep name finds PIDs by name, $$ is the current shell's PID, and $! is the PID of the last background job. Inside a container, the main process often sees itself as PID 1 thanks to PID namespaces.

Example

pgrep -a nginx
kill -TERM 4312