You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
riskcloudrun/findPortPid

8 lines
151 B

#!/bin/sh
if [ $# == 1 ]
then
netstat -antp|grep $1|awk '{c=$7;split(c,d,"/");print match(d[1],/\d+/)?d[1]:-1}'
else
echo port param not found!
fi