The sys admin's daily grind: socket statistics
Short Cut
Most sys admins use netstat to find out about the status of network sockets, but Charly knows a good shortcut.
A bunch of parameters control the behavior of netstat. Administrators can also happily combine options so that some netstat calls look like an armadillo has rolled across the keyboard. With ss (like socket statistics), there is an even more specific tool for this purpose. It comes from the iproute2 package [1] – just like its siblings bridge, rtacct, rtmon, tc, ctstat, lnstat, nstat, routef, routel, rtstat, and ip.
Because a running Linux uses several hundred or more ports, ss comes with plenty of filters. I mostly need the -t and -u parameters, which restrict the results to TCP or UDP sockets. Other parameters limit the list to raw, Datagram Congestion Control Protocol (DCCP), package, and Unix domain sockets.
Caution: The tool only displays TCP sockets for existing connections by default (established or close_wait). If I also want to see sockets in the lists status – as I usually do – I have to type ss -ta. If I only want the tool to pay attention to listening TCP sockets and suppress all others, I use ss -lt. If I add -p here, I can also see which process opened the socket. I need to use root privileges for this; otherwise, -p has no effect.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Fedora 43 Has Finally Landed
The Fedora Linux developers have announced their latest release, Fedora 43.
-
KDE Unleashes Plasma 6.5
The Plasma 6.5 desktop environment is now available with new features, improvements, and the usual bug fixes.
-
Xubuntu Site Possibly Hacked
It appears that the Xubuntu site was hacked and briefly served up a malicious ZIP file from its download page.
-
LMDE 7 Now Available
Linux Mint Debian Edition, version 7, has been officially released and is based on upstream Debian.
-
Linux Kernel 6.16 Reaches EOL
Linux kernel 6.16 has reached its end of life, which means you'll need to upgrade to the next stable release, Linux kernel 6.17.
-
Amazon Ditches Android for a Linux-Based OS
Amazon has migrated from Android to the Linux-based Vega OS for its Fire TV.
-
Cairo Dock 3.6 Now Available for More Compositors
If you're a fan of third-party desktop docks, then the latest release of Cairo Dock with Wayland support is for you.
-
System76 Unleashes Pop!_OS 24.04 Beta
System76's first beta of Pop!_OS 24.04 is an impressive feat.
-
Linux Kernel 6.17 is Available
Linus Torvalds has announced that the latest kernel has been released with plenty of core improvements and even more hardware support.
-
Kali Linux 2025.3 Released with New Hacking Tools
If you're a Kali Linux fan, you'll be glad to know that the third release of this famous pen-testing distribution is now available with updates for key components.

