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.
riskshell/shell/findPortPid

9 lines
151 B

4 years ago
#!/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