pkill

End processes by name

What it does

pkill works like kill but finds processes by name instead of by number and ends every one that matches. Handy when several processes share a name or you would rather not look up the PID.

The name matches any part of a process name, so first check what it will hit: pgrep -a <name> lists the same processes without ending them. -f matches the whole command line, not just the program name.

Careful. pkill ends every process whose name contains the pattern, other users' too when run with sudo. Check the list with pgrep -a first.

Syntax

pkill <name>
pgrep -a <name>

Examples

Related commands

Practise · All commands