netstat -tlnp | awk 'NR>=3{print $4"|"$7}' | egrep '[0-9]+|[0-9]+/./[a-zA-Z-]' -o|awk -F'[|/]' '{print $1,$NF}'|sort|uniq |sort -k 2
转自https://www.cnblogs.com/peitianwang/p/15210430.html