View connected file sharing clients' IP numbers

Dec 18, '02 08:10:36AM

Contributed by: BMarsh

This command looks for any connections to port 548 (Apple's File Sharing port), and lists the IP address of any connections through filesharing:

 % netstat -f inet -n | grep '.548 ' | awk '{ print $5 }' \
| sed 's/\.[^.]*$//'
I saw this while on the IRC channel (and server) for the MacFora web boards, I believe it was a person by the nickname "ian" that provided the script for the nice result. Someone else there mentioned they were working on an app to show the number of connections (for all types, not just filesharing) for those that don't want to use terminal.

I have only been able to test this for one connection so far.

Comments (8)

Mac OS X Hints