Posted By

plexus on 10/17/06


Tagged

pipe linux grep ubuntu sed xargs kill hal sudo processes


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

basicmagic
alexxx


kill processes by regex


 / Published in: Bash
 

URL: http://www.arnebrasseur.net

  1. #!/bin/bash
  2. ps ax | grep $1 | sed 's/\ \([0-9]*\).*/\1/g' | xargs kill -9

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: 3ED on October 9, 2008

ps axo pid,user,cmd|sed '/\ \ '"$USER"'./!d; /\ '"$1"'$\|\ '"$1"'\ /!d; s/\ ([0-9])./\1/g'|xargs kill -9

Posted By: 3ED on October 9, 2008

ps axo pid,user,cmd|sed '/\ \ '"$USER"'./!d; /\ '"gqview"'$\|\ '"gqview"'\ /!d; s/\ ([0-9])./\1/g'|xargs kill -9

ps. Mhm, markdoned ^^..

Posted By: 3ED on October 9, 2008

No! :[ Please, delete this, sux cms.

Posted By: 3ED on October 9, 2008

No! :[ Please, delete this, sux cms.

You need to login to post a comment.