How to use the ss (socket statistics) tool

Knowledge Base - How To

The ss command is a simpler and faster version of the now obsolete netstat
To look for tcp (t), udp, (u), listening ports (l), packet (p) as number (don't resolve service names), run $ ss -tulpn Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process udp UNCONN 0 0 0.0.0.0:161 0.0.0.0:* udp UNCONN 0 0 [::]:161 [::]:* tcp LISTEN 0 4096 0.0.0.0:42001 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:42000 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:42003 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:42002 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:42004 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:80 0.0.0.0:* tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:443 0.0.0.0:* tcp LISTEN 0 4096 127.0.0.1:45453 0.0.0.0:* tcp LISTEN 0 4096 0.0.0.0:29093 0.0.0.0:* tcp LISTEN 0 4096 127.0.0.1:3528 0.0.0.0:* tcp LISTEN 0 4096 127.0.0.1:9090 0.0.0.0:* tcp LISTEN 0 4096 127.0.0.1:9990 0.0.0.0:* tcp LISTEN 0 4096 [::]:42001 [::]:* tcp LISTEN 0 4096 [::]:42000 [::]:* tcp LISTEN 0 4096 [::]:42003 [::]:* tcp LISTEN 0 4096 [::]:42002 [::]:* tcp LISTEN 0 4096 [::]:42004 [::]:* tcp LISTEN 0 4096 [::]:80 [::]:* tcp LISTEN 0 128 [::]:22 [::]:* tcp LISTEN 0 4096 [::]:443 [::]:* tcp LISTEN 0 4096 [::]:29093 [::]:* Full flags/options can be seen with # ss -h