Linux tricks, one-liners & shell magic
← Back to all tricks
Find and kill a process by name

Quickly find the PID of a running process and kill it — no need to first run ps and note the ID manually.

bash
$ kill $(pgrep -f process_name) # Or with a signal: kill -9 $(pgrep -f process_name)
lars2026-04-19
Delete this trick? This cannot be undone.