Monday, March 21, 2011

Güzel bir olgu "Bash"

Hız önemli kimse uğraşmayıda sevmez. Bir kolaylık örneği. Her şekilde kullanabilirsiniz. Toplu process öldürme Örneği ; 
 
ps aux | grep cma

root       399  0.0  0.0 51124  664 pts/0    S+   15:06   0:00 grep cma
root      5995  0.0  0.0 63448  588 ?        Sl   Dec05   0:13 cmahealthd -p 30 -s OK -t OK -i
root      5998  0.0  0.0 12284  680 ?        Sl   Dec05   0:03 cmastdeqd -p 30
root      6048  0.0  0.0 12568  708 ?        S    Dec05   0:39 cmahostd -p 15 -s OK
root      6068  0.0  0.0  2456  208 ?        S    Dec05   0:00 cmathreshd -p 5 -s OK
root      6126  0.0  0.0 12472  608 ?        Sl   Dec05   0:03 cmasm2d -p 30
root      6232  0.0  0.0  2220  384 ?        S    Dec05   0:38 cmaperfd -p 30 -s OK
root      6234  0.0  0.0 12160   96 ?        S    Dec05   0:00 cmasm2d -p 30
root      6258  0.0  0.0 12704  864 ?        Sl   Dec05   0:02 cmapeerd
root      6314  0.0  0.0  4196  400 ?        S    Dec05   0:02 cmaeventd -p 15
root      6316  0.0  0.0 14688  472 ?        S    Dec05   0:02 cmafcad -p 15 -s OK
root      6349  0.0  0.0  1720   80 ?        S    Dec05   0:00 cmasasd -p 15 -s OK
root      6385  0.0  0.0  4484  628 ?        S    Dec05   0:07 cmaidad -p 15 -s OK
root      6405  0.0  0.0 11992  128 ?        S    Dec05   0:00 cmaided -p 15 -s OK
root      6438  0.0  0.0  1728   84 ?        S    Dec05   0:00 cmascsid -p 15 -s OK
root      6458  0.0  0.0 110564 1408 ?       Sl   Dec05   0:19 cmanicd  
root     32674  0.0  0.0 110560 672 ?        S    15:03   0:00 cmanicd  

Hostname:/opt/hp/hpsmh/sbin # ps aux | grep cma |awk '{print $11}' | grep -v grep | tr -t '\n' ' ' 
 
cmahealthd cmastdeqd cmahostd cmathreshd cmasm2d cmaperfd cmasm2d cmapeerd cmaeventd cmafcad cmasasd cmaidad cmaided cmascsid cmanic

killall -KILL `ps aux | grep cma |awk '{print $11}' | grep -v grep | tr -t '\n' ' '`
 
 
Başka bir örnek ;
cat /proc/31301/smaps | grep kB | grep -v "0 kB" | awk '{print $2}' | tr -t '\n' '' |sed 's/^/.+/' | bc

uzar gider.

No comments:

Post a Comment