ss -tln[p]
ss -tln[p]
Risk: Safe
What it does
Lists the ports that programs listen on.
When to use it
When a call is refused, or a port is already in use.
Example
$ ss -tlnTCP ports that listen, as numbers.
$ sudo ss -tlnpAdd the program behind each port. Needs root.
$ sudo ss -tlnp 'sport = :80'Only port 80.
Learn it in: Ports and listening: ss · Official docs