I have the newest Mac OS 10.12.3. With the new rootless system Apple has implemented, I can't create a symbolic link using ln
under /usr/bin
. My goal is so that I can use subl
in terminal. How can I do this?
2 Answers
The default directory for third-party executables in macOS is /usr/local/bin. Since this directory already is in the PATH you don't have to modify anything except sudo linking the executable to this dir.
If the directory doesn't exist, create it with sudo mkdir /usr/local/bin
. If you plan to install brew later, it's recommended to change the owner of the bin folder to your user.
-
-
-
I don't think that automatically creates the link though. Terminal still doesn't recognize the command.– B.LiJan 28, 2017 at 0:48
-
@B.Li, Saying "Terminal still doesn't recognize the command." without also providing the exact command you tried and the exact error message, leaves us without any information to diagnose your issue! Apr 14, 2017 at 14:52
Basically you symlink it. See this answer on github gist https://gist.github.com/artero/1236170
-
1Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone.– nohillside ♦Apr 14, 2017 at 14:30
-
The OP is not asking how to create a symlink per se, as using
ln
was already mentioned, but how to deal with SIP while creating a symlink at/usr/bin
. klanomath's answer already covers making the symlink at/usr/local/bin
as suggested in the link you posted. Apr 14, 2017 at 14:35