cmdxray / commands / pkill

What does pkill do?

signal processes selected by name or attribute — no PID needed.

▸ Explain your own pkill command →

pkill examples, explained

$ pkill -f node

  • pkillsignal processes selected by name or attribute — no PID needed
  • -fmatch against the full command line, not just the process name
  • nodean argument passed to the command

$ pkill -9 chrome

  • pkillsignal processes selected by name or attribute — no PID needed
  • -9SIGKILL — force the matching processes to stop immediately
  • chromean argument passed to the command

$ pkill -u www-data

  • pkillsignal processes selected by name or attribute — no PID needed
  • -umatch processes with the given effective user
  • www-datavalue for -u

pkill flags & options

-9SIGKILL — force the matching processes to stop immediately
-15SIGTERM — politely ask the matching processes to stop
-fmatch against the full command line, not just the process name
-umatch processes with the given effective user
-Umatch processes with the given real user
-xrequire an exact match of the process name
-nselect only the newest matching process
-oselect only the oldest matching process
-cprint a count of matches instead of signalling them

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.