Created
June 28, 2017 01:45
-
-
Save HouLinwei/0e27e816d4f2b48a720c59cececf4566 to your computer and use it in GitHub Desktop.
echo_pid_accodring_port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
port=$1 | |
pid=`netstat -nlp 2>/dev/null|grep ${port}|grep LISTEN|awk '{print \$NF}'|awk -F"/" '{print \$1}'` | |
echo $pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment