Quickly find and stop processes by name using the pkill command. 16.11.2025 | reading time: 2 min Need to stop a misbehaving background job fast? Use `pkill` to target processes by name and signal; he types a single command and the matching processes receive the signal immediately. Quick demo Try this on a shell: start two background sleepers, list them, kill by name and verify the result. ```bash sleep 300 & [1] 12345 sleep 300 & [2] 12346 ps -C sleep -o pid,cmd PID CMD 12345 sleep 300 12346 sleep 300 pkill sleep ps -C sleep -o pid,cmd PID CMD # no output means none running ``` Signals and matching tricks By default `pkill` sends SIGTERM; add a signal like `-9` to force-kill, use `-f` to match the full command line and `-x` for an exact name match; the pattern is treated as a regular expression so he must be careful with metacharacters. Safer workflows Preview targets with `pgrep` before killing, restrict matches to a user with `-u`, and prefer exact matches to avoid collateral damage; when in doubt he should capture PIDs and use `kill` to be explicit. Related commands to know `pgrep` helps you identify PIDs by pattern, `killall` removes processes by name on many Linux systems, and classic `ps` plus `grep` gives a quick visual confirmation before acting. Final thought and next step Mastering `pkill` speeds up routine maintenance but also teaches caution: pattern-based process control is powerful and must be used deliberately; learn more and consider formal certification like CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. processes utilities troubleshooting scripting