I have noticed that |
is used to send results of first command to the another. I would like to kill all processes that match a name.
This is what pgrep normally does:
$ pgrep name
5089
5105
And multiple arguments seem to work with kill
:
sudo kill 5089 5105
But this is wrong:
pgrep name | kill
So how to do it properly?
pkill
. And if that didn't exist,kill $(pgrep ...)
.man pgrep
. The downvote button says it's for when a question shows no research effort, and I couldn't see any in your question. Sorry if that seemed harsh.