?今天寫了兩個比較得意的命令, 來炫耀一下, 嘿嘿
如何kill掉進程名包含某個字符串的一批進程:
#!/bin/sh
kill -9 $(ps -ef|grep 進程名關鍵字|gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ' ')
觀測進程名包含某個字符串的進程詳細信息:
#!/bin/sh
top -c -p $(ps -ef|grep 進程名關鍵字|gawk '$0 !~/grep/ {print $2}' |tr -s '\n' ','|sed 's/,$/\n/')