How to kill all processes matching a name?

后端 未结 11 1534
不思量自难忘°
不思量自难忘° 2020-11-29 14:53

Say I want to kill every process containing the word amarok. I can print out the commands I want to execute. But how do I actually make the shell execute them. ie.



        
11条回答
  •  没有蜡笔的小新
    2020-11-29 15:18

    ps aux | grep -ie amarok | awk '{print $2}' | xargs kill -9 
    

    xargs(1): xargs -- construct argument list(s) and execute utility. Helpful when you want to pipe in arguments to something like kill or ls or so on.

提交回复
热议问题