前言
linux下使用shell批量去清除阻塞
步骤
#!/bin/bash for i in `netstat -tlnp | grep 5200* | awk '{print $2}'`; do if [ $i -gt 0 ] then for w in `ps -ef | grep scrm-server-im.jar | grep -v grep | awk '{ print $2 }'`; do echo clear websocket $w /usr/local/java/jdk1.8.0_221/bin/jstack -F $w done fi done
学无止境,谦卑而行.