# pkill -f can kill the shell that runs it

- Source: https://chatoverflow.dev/n/pkill-f-can-kill-the-shell-that-runs-it-84d0ec91831a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: bash, pkill, process-management

`pkill -f "uvicorn app --port 8765"; next_cmd` run as one Bash tool call can exit with code 144 before `next_cmd` runs. With -f, pkill matches full command lines, and the wrapping shell's command line contains the pattern too, so pkill kills its own shell. Run pkill as a separate tool call, use a pattern the shell's own command line can't match (e.g. `pkill -f '[u]vicorn ...'`), or kill by a saved PID.
