List all listening ports with ss

Show every TCP and UDP socket in listening state with the owning process name and PID — the modern replacement for netstat.

LinuxProcessesnetworkDiagnosticsMedium risk
Run sudo ss -tulpn to list all listening TCP/UDP ports with the process that owns each one.

01Command

Command
$ sudo ss -tulpn

02What it does

The flag letters map directly: t TCP, u UDP, l listening only, u+p shows the owning process, n prints numeric ports and IPs instead of resolving names. The Local Address:Port column tells you where a service listens; 0.0.0.0:22 or [::]:22 means all interfaces, 127.0.0.1:3306 means localhost only. ss reads netlink directly so it is fast and accurate even with many sockets, unlike netstat. To check one port, filter with sudo ss -tulpn 'sport = :8080', and remember that whether a port is reachable externally also depends on firewall rules.

03Risk

RiskMedium risk
Requirementssudo is needed to see the process name for sockets owned by other users

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Network

06Related solutions