Show all of the processes and any open ports that they may be using.
for pid in `ps -aeo pid | grep -v PID`; do sudo pfiles ${pid} | egrep “^${pid}:|sockname:” done
Once you know the PID’s of the processes you can determine all of the atributes of the applications using pargs, instead of ps. [...]
