1. Open Terminal.app (found in Applications -> Utilities)
2. Type lsof -i
3. Hit ENTER
lsof will now show you the list of network connections. If you have administrative rights you can run "sudo lsof -i" to see *all* connections, even those made by system processes such as daemons.
lsof outputs a variety of information by default but we're mostly interested in:
- COMMAND - The name of the command or program
- PID - Process ID of the connected program, you can use this to get more information about the program later. e.g You can look for this PID in Activity Monitor.app to see more statistics
- USER - The name of the user running this app, usually this is your user name or "root" if the process is a system service/daemon
- NAME - The address and port the application is connected to. If you see something similar to *.* or *: that means the application is listening for connections.