软件测试基础-Linux常用shell脚本
批量kill进程号
eth='5668 5673 7733 7738 10512 10517 12453 12458 17134 17139 18075 18080 20340 20345 21120'
for name in $eth
do
echo "Pid is $name"
echo "kill -9 $name"
kill -9 $name
done
通过进程名kill
ps -ef| grep tomcat|awk '{print $2}'|xargs kill -9
查找所有的java进行,然后打印出来
pidlist=`ps -ef|grep java |grep -v "grep" |awk '{print $2}'`
if [ "$pidlist" = "" ]
then
echo "no java process alive"
共有 0 条评论