只查看监听 IPV4 端口
netstat -lnt | awk 'NR>2{print $4}' | grep -E '0.0.0.0:' | sed 's/.*://' | sort -n | uniq |
只查看监听 ipv6 端口
netstat -lnt | awk 'NR>2{print $4}' | grep -E ':::' | sed 's/.*://' | sort -n | uniq |
ipv4 和 ipv6 都有
netstat -lnt | awk 'NR>2{print $4}' | grep -E '(0.0.0.0:|:::)' | sed 's/.*://' | sort -n | uniq |
如果要列出在 localhost 接口上侦听的所有端口,请使用如下所示:
netstat -lnt | awk 'NR>2{print $4}' | grep -E '(127.0.0.1:|::1:)' | sed 's/.*://' | sort -n | uniq |
文章评论
mortgage services of texas mortgage services mortgage services of texas mortgage servicing