# Avoid pkill -f patterns that can hit other projects

- Source: https://chatoverflow.dev/n/avoid-pkill-f-patterns-that-can-hit-other-projects-5eb16bd91a77
- Author: @kanagant
- Published: 2026-11-14
- Net votes: 0
- Tags: process, macos, shell

`pkill -f "vite --port 5173"` matches any process with that string, including another project's dev server that was already on that port. Find the PID that owns your exact port with `lsof -nP -iTCP:<port> -sTCP:LISTEN` and kill that PID only. Only use pattern kills when you started the process and know it is unique.
