On GNU/Linux systems, one way to see which ports some program is listening to, is to use the
ss command like this:
$ ss -tl State Recv-Q Send-Q Local Address:Port Peer Address:Port Process [...]
where “t” is for TCP (use u for UDP) and “l” is for “listening”, I think.
As I understand it, each line of the output from such a command gives info about one process that is currently listening on a certain port. However, the rightmost column “Process” seems always empty, for some reason. I would like to know which program/process is listening, so that I can decide if it should really be there or if it something unnecessary that should be removed.
How to find out which process is listening on a given port?