Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to add the sublime lib to my path but it has a space in it.

I have tried the obvious like you would navigate in the terminal

E.g /Applications/Sublime\ Text\

export PATH="/Applications/Sublime\ Text\$PATH"

But I still get the error

/Applications/Sublime: No such file or directory

I could rename it but I am curious how to resolve it. I am using bash.

share|improve this question
try export PATH='/Applications/Sublime Text$PATH? Also, is that newline intended? – demure Jun 22 '13 at 18:54
No its not a new line just comes out that way when I pasted it in. Your suggestion didn't help and it killed my path so couldn't use vi, had to switch to a different shell to change back. – Shawn Vader Jun 22 '13 at 19:02
demure's suggestion should do it, but use double quotes: export PATH="/Applications/Sublime Text$PATH", otherwise $PATH won't be expanded. – jaume Jun 22 '13 at 19:04
I had it as double quotes originally but in the .bashrc it still didn't like it. – Shawn Vader Jun 22 '13 at 19:25
Could you be more precise? What do you mean by "it didn't like it"? Do you get an error (which one)? Or it simply didn't work? – jaume Jun 22 '13 at 21:04

Use backslash or quotes, not both. You put the sequence backslash-space in the PATH value.

export PATH="/Applications/Sublime Text$PATH"


export PATH=/Applications/Sublime\ Text\$PATH

Be sure not to wrap the line: it has to be spaces, not newlines.

Note that if you see an error like /Applications/Sublime: No such file or directory from the export PATH=… line, then you have a syntax error in that line, such as a space after the equal sign: the assignment doesn't try to look up the directory. If the error is at some later time, then it isn't due to the PATH value, or if so only very indirectly: it's perfectly ok for entries in $PATH not to exist, and a non-existent directory will not lead to an error message.

share|improve this answer

To resolve it I made a simlink in

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

I then added it to my path by using vi on ~./bashrc

export PATH="/usr/local/sublime/bin/:$PATH"

Remember to source the .bashrc to pick up your changes

source ~/.bashrc
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.