美文网首页
关闭指定名称的进程

关闭指定名称的进程

作者: 遇银 | 来源:发表于2020-03-10 13:35 被阅读0次

下面示例是kill 名字叫modbus_master的进程

#!/bin/sh


modbus_pid=`ps -ef | grep modbus_master | grep -v grep | awk '{print $1}'`

if [ -z "$modbus_pid" ];

then

 echo "[ not find modbus_master pid ]"

else

 echo "find result: $modbus_pid "

 kill -9 $modbus_pid
 echo "modbus stoped"

fi

相关文章

网友评论

      本文标题:关闭指定名称的进程

      本文链接:https://www.haomeiwen.com/subject/bzswdhtx.html