# Turn File Sharing On/Off via command line?



## TommyWillB (Nov 5, 2004)

I'm @ work and want to grab a bunch of file from my Mac @ home... I leave Personal File Sharing on when I know I'll need to do this, but currently it's off.

I have SSH enabled on my machine at home, and so I'm wondering if there is a command-line way of toggling this On/Off... or is the Pref Panel GUI the only way?

I know there are about 15 other ways I can get my files, but this seems like it would be the easiest...


----------



## davidbrit2 (Nov 5, 2004)

As it turns out, this is insanely easy to do.

To start AFP:
sudo AppleFileServer

To stop AFP:
sudo killall -TERM AppleFileServer

And that's it.


----------



## TommyWillB (Nov 6, 2004)

Great!

 Thanks


----------



## davidbrit2 (Nov 6, 2004)

Oh, one more thing: this launches the file server daemon, but it doesn't start up the other daemon that advertises the service over Rendezvous. So don't be startled that it doesn't show up.


----------



## roadrunnersrg (Aug 27, 2010)

Anyone know how to get this to work in 10.6 with Bonjour availability?

I'm not seeing that:

sudo AppleFileServer


still works in 10.6

Thanks


----------

