title: How to create a symbolic link when target directory doesn't exist?
body: <p>Is there a flag you can add to the <code>ln</code> command to force the creation of the target directory structure (like <code>mkdir -p</code>).</p>
  
  <p>Consider :</p>
  
  <pre><code>ln -s /Applications/'Sublime Text.app'/Contents/SharedSupport/bin/subl /usr/local/bin/
  </code></pre>
  
  <p>Which adds a symlink to the Sublime Text command line tool. But it fails if /usr/local/bin/ doesn't exist.</p>
  
  <p>I've tried the <code>-f</code> 'force' flag but that doesn't help. </p>
  
  <p>Do you need to test wether /usr/local/bin/ exists and create it if it doesn't before running the <code>ln</code> command or is there a fancier way to do it?</p>