Linux Command: ss
Show socket statistics (modern replacement for netstat)
ss (socket statistics) is the modern replacement for netstat, providing faster and more detailed network socket information. It is part of the iproute2 package and is the recommended tool for inspecting network connections. ss can display TCP, UDP, Unix, and raw socket information. It supports powerful filtering by state, address, port, and process, making it ideal for troubleshooting network issues on busy servers. ss queries the kernel directly using netlink, making it significantly faster than netstat on systems with many connections. It also provides more detailed TCP state information including congestion window, RTT, and buffer sizes.
Syntax
ss [OPTION]... [FILTER]Common Examples
sudo ss -tulnp— Shows all listening TCP/UDP ports with process names — the most common usage.ss -s— Quick overview of all socket types and their states.ss -tlnp sport = :443— Shows only connections on port 443.ss -tn state established— Shows only currently established TCP connections.
Pro Tips
Master this and 230+ other Linux commands with our comprehensive eBooks and cheat sheets.
Related Resources