Super User is a question and answer site for computer enthusiasts and power users. 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 have this in my ~/.bash_profile:

export PATH

But sublimetext in the folder isn't added to the path. Sublime Text gives this output when submitted to the file command:

sublime_text: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
share|improve this question
can you show the output of: ps -p $$ | tail -1 | awk '{print $NF}', ls -lad ~/Downloads/sublimetext, and ls -la ~/Downloads/sublimetext/sublime_text? – Christopher Neylan Feb 23 '12 at 23:17
It looks the problem here is that your PATH statements aren't sourced, so you need to make sure you do exactly that: source ~/.bash_profile and then look at echo $PATH. – user111228 Feb 24 '12 at 17:49
up vote 2 down vote accepted

PATH contains directories, not executable files. Try PATH=$PATH:~/Downloads. Although, really, you shouldn't be putting your downloads directory in your path; move the executable somewhere appropriate. Make a ~/bin directory, for example.

share|improve this answer
I've moved sublimetext to ~/bin and added that to my path. Thing is sublime text is a directory, which contains the binary file sublime_text. So I am already referencing a directory in my path, not a directory. Nevertheless it won't come up when i try to execute it from the shell. – fergusdawson Feb 23 '12 at 19:55
So, be more specific about "won't come up". Exactly what happens? Is there an error message? – jjlin Feb 23 '12 at 21:14
what I meant by it was that it isn't included in the path. I get a standard 'cmd not found' error if I try to execute the program from outside the directory it's stored in. I'm definitely declaring it correctly in bash_profile because if I do the same thing with another executable (a python script for example) it works and I can call it from anywhere. So you can see from this that the problem isn't with the file not being executable, or not adding it to the path correctly. Hopefully I'm being clear enough. – fergusdawson Feb 23 '12 at 23:09
It sounds like your PATH still isn't right, then. Can you update your question with the output of echo $PATH? – jjlin Feb 24 '12 at 0:10

It seems that you are modifying wrong .bash_profile. If you are root user then you have to modify /root/.bash_profile. Try sourcing as source /home/username/.bash_profile or source /root/.bash_profile and then check $PATH.

Please follow the summary at

share|improve this answer

Is it set in permissions to be executable ? (chmod o+x ~/Downloads/sublimetext/sublime_text to make it)

share|improve this answer
I've been executing it with ./sublime_text so it is executable. I just tried your command and it didn't change anything. – fergusdawson Feb 23 '12 at 20:14

First off check if you should be using the 32-bit or 64-bit version.

Secondly create a shell script:

# sublime shell script
# make sure there is no spaces in path.

if [ -d "$HOME/Downloads/SublimeText2" ] ; then

sublime_text $@

Now drop it in your ~/bin and make it executable.

$ chmod +x sublime

~/Desktop$ sublime -h | head -1

Sublime Text 2 Build 2181
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .