I want to see which port, e.g. postgresql is listening on, so I use:
But that is trying to be clever and prints the process name instead of the port:
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:postgresql *:* LISTEN tcp 0 0 *:31416 *:* LISTEN
How can I determine which port any process is listening on with netstat?