Set up Sublime Text in Mac/Apple; Fix "zsh: command not found: subl" Error

Sublime Text is a popular cross-platform source code editor. You can download it from here and install it.

As a developer, you may have tried to edit or create a file in Sublime Text or simply launch it in the lines of Nano or Vim by typing the following command into the terminal


and most likely have encountered the following an error message: zsh: command not found: subl.


This is because some soft link commands still need to be executed. But before that, remove any existing /subl directory inside /usr/local/bin

				sudo su -
				rm /usr/local/bin/subl

Next go to /Applications directory and check which version of Sublime Text you installed.

				cd /Applications

If it is Sublime Text version 3, do

				ln -s "/Applications/Sublime" /usr/local/bin/subl

else if it is version 2, do

				ln -sv "/Applications/Sublime Text" /usr/local/bin/subl

Close the terminal and start it again. Type


into the terminal and press ENTER. Sublime Text will now be launched.