/ Published in: Bash
Filters for tcp and tcp6 lines, so omits udp and unix sockets.
Information is gathered from /proc; this uses netstat mainly to format it.
Gives output like:
21 tcp LISTEN
12 tcp ESTABLISHED
7 tcp6 LISTEN
1 tcp TIME_WAIT
Expand |
Embed | Plain Text
netstat -nal |egrep '^tcp' | sed -r 's/[ ]+/ /g' | cut -d ' ' -f 1,6 | sort | uniq -c | sort -rn
You need to login to post a comment.
