So I just started getting into using terminal to manage files etc, and I was trying to setup my sublime text shortcut using this line of code:
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime
However, when I try to do this it says Permission Denied and I have no idea why. I am using a Mac running Mac 10.10.2
.
If you are on Mac, I would suggest creating a file
/usr/local/bin/sublime
or somewhere else on yourPATH
and puttingopen -a Sublime\ Text $@
inside instead of creating a link.open -a
tells Mac to open an application that is in your/Applications/
directory. and the$@
symbol passes on any additional arguments that you supply to the script. Thus, you can open a file by doingsublime file.ext
. That said, it is possible that your permission denial is that you don't have permission for the/usr/local/bin
directory. If that is the case, you need to change the permission usingchmod
, or just put the script somewhere else like~/bin