Why ss exists
ss is part of iproute2 and talks to the kernel over netlink, so it scales better on hosts with huge connection tables. netstat historically parsed /proc and lived in the older net-tools package—still correct, just slower and less featured.
Everyday mappings
| Goal | ss | netstat |
|---|---|---|
| Listeners + PIDs | ss -tulpn | netstat -tulpn |
| Established flows | ss -tan state established | netstat -tan + grep |
| Timers / congestion | ss -ti | Limited / varies |
Scripting tips
Use ss -H to omit header, ss -4/-6 to split stacks, and JSON output on newer versions for parsers—avoid brittle column slicing.
Related: using netstat and ss, checking open ports, Linux networking commands, iptables vs UFW.