Skip to main content
⚑ OpenDevDocs
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
FlagMeaning
-tDisplay TCP sockets.
-uDisplay UDP sockets.
-lShow only Listening sockets (omits established connections).
-nDo not resolve service names (show numeric port numbers like 3000 instead of http).
-pShow the Process name and PID using the socket (requires sudo).

On this page