4

Is there a way to open files using Sublime from OSX terminal:

Like this in Linux, but the equivalent in OSX:

gedit file.txt
1

3 Answers 3

8

You can also create a symbolic link to Sublime Text to launch it from the terminal with a simple command like "sublime path":

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

You should change the installation path accordingly. It's also possible to use any other alias than sublime, but it's best to be explicit.

Sign up to request clarification or add additional context in comments.

Comments

2

You can use the general command for opening files with an application, like:

open -a Sublime.app file.txt

2 Comments

If the question is about application program "Sublime Text", this would be the call for v. 2: open -a Sublime\ Text\ 2.app file.txt, probably likewise for v.3.
yes, it worked for me as open -a /Applications/Sublime\ Text.app/ text.js
0

This should work:

open /Applications/Sublime\ Text.app

If you want to keep sublime as an alias for future use you can add it to your .bash_profile:

echo "alias subl=\"open /Applications/Sublime\ Text.app\"" >> ~/.bash_profile
source ~/.bash_profile
sublime

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.