Mastering Network Socket Identification with ss state filters
Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Mastering Network Socket Identification with ss state filters
🧩 The Challenge
Identifying specific problematic connections becomes tedious when dealing with thousands of active sockets on a busy server. Standard output lists too much noise, making it difficult to isolate connections in specific states like closing or waiting.
💡 The Fix
Use the built-in state filtering capabilities of the ss utility to narrow down results to specific TCP connection phases instantly.
ss -tan state established state time-wait
⚙️ Why It Works
The state filter acts as a native predicate for the ss tool, instructing the kernel to only return sockets matching your criteria before the data is even processed by the command output.
🚀 Pro-Tip: Append the ‘exclude’ keyword to the state filter to ignore established connections and focus purely on troubleshooting pending or hung sessions.
Linux Tips & Tricks | © ngelinux.com | 7/6/2026
