File Sharing Hints

Mac OS X comes with a full set of tools and utilities for file sharing, but that’s only the beginning. Much more flexibility awaits in Terminal.

File Sharing from the Command Line

You are the featured speaker at a food industry conference, and you’ve been asked to give your famous speech, “Soggy in Seattle: Why Salad Dressing Should Always Be Served on the Side,” along with an accompanying PowerPoint presentation. You stride confidently to the podium, laptop tucked under your arm, ready to boot up and knock everyone out of their socks.

But then, wouldn’t you know it...as soon as the laptop starts humming, you realize you forgot to transfer your presentation from your desktop computer. Initial response: you’ll just hop online and grab your presentation via Personal File Sharing, which you activated on your home machine before you left. Or did you?

Alas, when you try to reach your desktop’s files, you are summarily thwarted: you never switched on Personal File Sharing.

Fortunately, using ssh ( Section 6.3.2) in Terminal, you can connect to your home machine, type sudo /usr/sbin/AppleFileServer, then enter your administrator password at the prompt and press Return. This command launches Personal File Sharing on your home machine. Congratulations! You can now access your home computer through the Go Connect to Server command in the Finder.

Note

If, for some reason, you need to turn off Personal File Sharing from the command line, type ps -ax | grep -i applefileserver ...

Get Mac OS X Power Hound, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.