Networking
networkingnetworkingReferenceBeginner
Check Open Ports (netstat & ss)
Display all active TCP and UDP listening sockets and process mappings on a server.
Verified: 2026-09-30
Tested on:linux Ubuntu 24.04
Platforms:
linuxmacos
#networking#ports#netstat#ss
Command
sudo ss -tulnp
Short Description
ss (Socket Statistics) is the modern replacement for netstat. It dumps open network sockets, listening ports, established connections, and which process owns each socket.
Syntax & Common Flags
sudo ss -tulnp| Flag | Meaning |
|---|---|
-t | Display TCP sockets. |
-u | Display UDP sockets. |
-l | Show only Listening sockets (omits established connections). |
-n | Do not resolve service names (show numeric port numbers like 3000 instead of http). |
-p | Show the Process name and PID using the socket (requires sudo). |