How do I add ~/bin to my path?

前端 未结 13 967
太阳男子
太阳男子 2020-12-22 19:30

I\'ve been having trouble modifying my path to add Sublime Text 2. I\'ve added a ~/bin directory and run this command:

ln -s \"/Applications/Sub         


        
13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 19:46

    Here are the full instructions to do this (for Sublime Text 3):

    1. Please check your System Integrity Protection status by the following command:

      $ csrutil status
      

      If it's enabled, please follow these steps:

      1. Boot to the Recovery OS of OS X by restarting your machine and holding down Command + R at startup.

      2. Launch Terminal from the Utilities menu.

      3. Run the following command:

        $ csrutil disable
        $ reboot
        

      This is due to a security feature of OS X called System Integrity Protection, which will protect against unauthorised access to system locations and processes. So if this feature is enabled, you won't be able to modify the content of /usr/bin.

    2. Create a symlink from /usr/bin to ~/bin:

      $ sudo ln -s /usr/bin ~/bin
      
    3. Create a symlink from the Sublime Text 3 CLI tool to ~/bin:

      $ sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin
      
    4. Test it.

      $ subl .
      

提交回复
热议问题