MacOS – What process is using UDP port

macosunix

I am trying to install a server that needs to use the port 3052 and it's not working. I have a feeling another process has that port. I see:

% netstat -anv | grep 3052
udp4       0      0  *.3052          *.*          196724   9216    335      0

So what does this mean? Does some process have UDP port 3052 taken, and how do I find out what it is?

Best Answer

You can use the lsof command to get more insight into what process is using a specific port. In your case, you'd issue the command lsof -i4UDP:3052. Read the man page for more information about how to use the tool, as it is slightly different between current and older macOS versions.

One of the columns displayed by lsof, the PID column, will show the ID of the process that is using that port. You could find out more about the process using ps.