sudo netatat -aopn
to get a list of processes which are in operations with ports on the system. The "p" parameter required superuser access to get the pid.
On Windows 10 (and perhaps others) one can do the same
Using an administrator privilged cmd window, you get the same access as superuser for accessing ports
netstat -abno in that window will show all the processes on the system and their pids
To determine the process name associated with each pid
will do that. One can locate a specific task with for example:
tasklist /fi "pid eq 4444"