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.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20021218051036223