使用 netstat -v 获取端口 grep

Get Ports grep using netstat -v

我想使用 netstat -v grep 获取已建立连接的端口列表。

我正在尝试这个:

sudo netstat -v | grep "ESTABLISHED" | cut -d: -f5

有什么帮助吗?

请尝试

netstat -v| grep "ESTABLISHED"| awk '{print }' | cut -d ":" -f2

</code> 和 <code> 试试这个:

netstat -v | awk '/ESTABLISHED/ {split(, array, ":"); print array[2]}'