Open Sublime Text from Terminal in macOS


Steps: 

Step 1: Open Terminal

Step 2: Hit below command.

For mac 10.8+

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Step 3: Now you can open sublime with the following command

subl "/a/path/to/the/directory/you/want/to/open"

More info: Run subl --help,
Usage: subl [arguments] [files]         edit the given files   or: subl [arguments] [directories]   open the given directories   or: subl [arguments] -               edit stdinArguments:  --project <project>: Load the given project  --command <command>: Run the given command  -n or --new-window:  Open a new window  -a or --add:         Add folders to the current window  -w or --wait:        Wait for the files to be closed before returning  -b or --background:  Don't activate the application  -s or --stay:        Keep the application activated after closing the file  -h or --help:        Show help (this message) and exit  -v or --version:     Show version and exit--wait is implied if reading from stdin. Use --stay to not switch backto the terminal when a file is closed (only relevant if waiting for a file).Filenames may be given a :line or :line:column suffix to open at a specificlocation.


References: http://www.sublimetext.com/docs/2/osx_command_line.html

Tags:

open sublime text 3 from terminal,open sublime from terminal ubuntu,open sublime from terminal mac os,open sublime from terminal windows,subl command not found mac sublime text 3,how to open sublime text,open file in sublime from terminal ubuntu,sublime text osx terminal,subl command not found,open sublime from terminal windows,open sublime from terminal ubuntu,bin/subl: no such file or directory,sublime open bash,ln: /usr/local/bin/sublime: permission denied,sublime terminal view,set editor to sublime,ln permission denied mac,sublime command line ubuntu,ln: /bin/subl: operation not permitted,sublime command line windows 10,sublime text command line plugin,sublime commands,mac sublime text 2 command line,sublime_text command options