shell脚本之进程的查找与结束

186 阅读1分钟

1、查找并结束包含mysql的进程脚本

#!/bin/bash

pids=`ps aux | grep mysql* | grep -v grep | awk '{print $2}'`
if [ -n "$pids" ]; then
        kill -9 $pids
fi

2、TODO