View sorted list of connected IPs

View sorted list of connected IPs

screenshot130107-133830At points one may need to quickly check and see who is connected to a server – and in case of servers running services such as http, ftp (so on) the number of their connections.

The netstat program does indeed display the list of connections, but browsing through it when there is a large number of connections is rather difficult.

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

will display a nicely sorted ascending list of IPs and their respective connection count.

Leave a Reply