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 Learn more about PID (Process ID)
- Understanding Linux Processes Every running program on Linux is a process. Understanding process IDs, states, parent-child relationships, signals, and how the kernel schedules work is essential for diagnosing problems and administering any Linux system.
- Killing Processes in Linux Killing a process on Linux means sending it a signal. Understanding the difference between SIGTERM and SIGKILL, how to find the right process to target, and what to do when a process refuses to die covers everything you need.