Post History
Use netstat -lp. Typically in such a scenario you will likely be mostly interested in IP sockets, in which case you can also add -A inet,inet6. To get numerical port numbers, add -n as well. (See ...
Answer
#1: Initial revision
Use `netstat -lp`. Typically in such a scenario you will likely be mostly interested in IP sockets, in which case you can also add `-A inet,inet6`. To get numerical port numbers, add `-n` as well. (See the man page for details.) Look at the "local address" field to find the port binding in question, and then look at the "PID/Program name" field to determine which application has bound to that port. The contents of /proc/*pid*/cmdline and the target of the /proc/*pid*/exe symlink may help you narrow down which process and invocation that is. `pstree pid` can also be helpful. In all three cases, replace the literal "pid" with the actual process ID value as determined from `netstat` output.