How do you check what is listening on a port and who is connected?
BeginnerScenarioPerformance, MTU, Latency & Tools
Answer
Situation read → Everyday server diagnosis.
What I'd do →
ss -tulpnlists listening TCP and UDP sockets with process namesss -tn state established '( dport = :443 )'shows active connectionslsof -i :8080shows the owning process- From another host use
nc -zv host 8080orcurl -v telnet://host:8080 netstatis deprecated in favour ofss
Why → ss reads kernel socket tables directly and is faster than netstat.
Interview tip → Say listening on 127.0.0.1 versus 0.0.0.0 is the first thing to read.
More on Performance, MTU, Latency & Tools
Latency, bandwidth and throughput: what is the difference and why does it matter?BeginnerWhen do you use ping, traceroute and mtr?BeginnerWhat is MTU and what is the usual value?BeginnerHow do you measure where time goes in a slow HTTP request?BeginnerWhat does tcpdump do and what are the first filters you use?BeginnerTCP or UDP: how do you choose for an application?Beginner