List listening ports on Linux
Show all TCP/UDP sockets that are listening, with the owning process.
Run the command below. It prints every listening TCP and UDP socket with local address, port and process name. Prefix with sudo to see process names for sockets owned by other users.
01Command
Command
$ ss -tulpn02What it does
ss is the modern iproute2 replacement for netstat and is installed by default on most distributions. -t TCP, -u UDP, -l listening only, -p show processes, -n numeric ports. Use it to find which service occupies a port before changing configs.
03Risk
!Warning: Only act on processes you recognize; system services legitimately listen on many ports.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- ss(8) — another utility to investigate socketsEvidence: ss -tulpn displays TCP/UDP listening sockets with processes; -p needs privileges for other users' sockets.
Last verified: 2025-11-21 · Category: Network