#!/bin/bash Port=8900 ID=`netstat -anp|grep $Port|awk '{printf $7}'|cut -d/ -f1` echo $ID kill $ID