Make a command line shortcut for Sublime Text on macOS
I know it’s handy to open Sublime Text using Alfred but sometimes I really want to open Sublime via my favorite terminal using a simple command line.
Here is how to do it:
1. Find where is located the Sublime Text executable on your Mac
find / -name "subl" 2> /dev/null
It’s usually located in
/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
2. Create a symbolic link in /usr/local/bin/
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
3. You are done.
You can now try to open:
- a file:
subl file.txt
- the current directory:
subl .