CSDN博客

img hide1713

Bash tip: How to stop many processes in with a small script

发表于2008/9/27 23:53:00  634人阅读

Task:
Kill many processes with same name. If your program use a lot fork(), It will generate many same name process. 

How to do this:


#!/bin/bash
s=$( ps aux|grep <application name here>|head -n -1|cut -d ' ' -f 2-3)
for foo in $s
do
        echo "kill " $foo
        kill $foo
done

save it and change the application name
阅读全文
0 0

相关文章推荐

img
取 消
img