# Command to see Sharing



## bobw (Apr 28, 2005)

Is there a Unix command to see who is connected over the net using persoanl File Sharing?


----------



## Lycander (Apr 28, 2005)

Best I can find is http://manuals.info.apple.com/en/MacOSXSrvr10.3_CommandLineAdminGuide.pdf

And it seems OSX Server specific. *shrugg*



> List of SMB serveradmin Commands
> You can use these commands with the serveradmin tool to manage SMB service.
> 
> *getConnectedUsers* List users currently connected to an SMB service.See Listing SMB Users  on this page..
> ...


----------



## Lycander (Apr 28, 2005)

If it's smb shares you want to monitor:

http://nic.phys.ethz.ch/readme/69#Connected users

Connected users

smbstatus -b
Prints the connected users to each Samba host on the current server.


----------



## magik23 (Apr 29, 2005)

Mac OSX Server has GUI based admin tools that will show who is connected and what protocol they are using.

While the server admin tools are interesting, the original question was about Unix tools and "personal file sharing".

To expand on the original question just a bit, when personal file sharing is turned on, is there ANY easy way (or even not so easy way) to see if anyone is currently connected and, if so, who and what protocol (afp over appletalk, afp over tcp/ip, smb, etc.)

Back in the ancient OS9 days you could just go to the file sharing control panel and look.


----------



## ksv (May 6, 2005)

You can use netstat:

```
netstat -n | grep '.548 '
```
will list all connections on port 548, which is AFP. See

```
man netstat
```
about what the columns mean.


----------

