Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find a command to make a shared folder with the terminal to integrate in a shell script. But i couldn't find anything for making a shared folder on a MAC OS X client. Can you guys help me with this?

share|improve this question
what type of file sharing have you set up on the Mac? AFP or SMB? – Stu Wilson Jun 23 '12 at 20:55
could you describe the steps you would use in the finder? – meduz Jun 30 '12 at 14:02

Take a look at this article by Mike Barron, NetBoot Part 4.

In the article Mike walks through the dscl commands he used to share folders on Mac OS X for the Apple Filing Protocol (AFP) and Server Message Block (SMB) protocols:

The toughest one so far has been file sharing. In our lab we share all our Work partitions to the entire internal network over AFP and SMB. In the past we used SharePoints to modify the NetInfo database to do so, but this functionality has all been moved over to Directory Services. To complicate matters, SAMBA no longer relies simply on standard SMB configuration files in standard locations, and the starting and stopping of the SMB daemon is handled completely by launchd. So figuring this all out has been a headache. But I think I’ve got it!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.