Just learned a new tool that has somehow escaped me the last 15 years. prep is a simple tool that lets you grep through the names of running processes, returning just the PIDs. pkill takes that a step further, killing the matched processes1. The cool thing is that both support tab-completion under zsh.
To find all running processes with the name
-l switch shows the process name as well
Note how without the
-l switch we don’t know that we’re matching
FinderSyncExt. Good thing we didn’t run
To match exactly, the
-x switch is used. This can help solve the problem of
matching too greedily, especially when using
Perhaps the too-greedy-by-default is why must instructions found on the web use killall over pkill. Still, I am liking the tab-completion offered by zsh.
A note of warning: pkill will kill processes that match only partially. So
pkill Finderwill kill
FinderSynExtprocesses. Be careful! ↩