3767 Views 7 Replies Latest reply: Sep 25, 2010 4:55 PM by avraamjack
just adding detail to what Bob suggested.
sudo lsof -i
lsof -i [protocol][@hostname|hostaddr][:service|port]
so something like:
sudo lsof -i 4tcp:631
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
launchd 1 root 19u IPv4 0x0480bb4c 0t0 TCP localhost:ipp (LISTEN)
cupsd 19 root 6u IPv4 0x0480bb4c 0t0 TCP localhost:ipp (LISTEN)
I was just about to post the same question but fortunately did a search on sockstat.
netstat -a shows open ports and connections ( http ) that lsof -i does not seem to list. I wanted bytes in and out per open port but do not see that option.
The netstat man page does list sockstat in the "SEE ALSO" section. At the very least, apple should do a better job maintaining its man pages.
I came to this question because my mini was doing a suspiciously large amount of network IO and I wanted to find out not only which ports were open but as much about them as possible, especially how much IO per port.
Avraam Jack Dectis