0

Is there a way to kill multiple processes? e.g.

kill -9 49855 49856

I have tried using commands like pkill but they require a single pattern and do not allow multiple pid inputs.

Kong
  • 1,241

1 Answers1

2

The bash shell's builtin kill appears to accept only a single PID (or jobspec). However the external kill command (from package procps) accepts multiple pids:

$ sleep 60 & sleep 60 &
[1] 25208
[2] 25209

$ /bin/kill 25208 25209 [1]- Terminated sleep 60 [2]+ Terminated sleep 60

steeldriver
  • 136,215
  • 21
  • 243
  • 336