This question already has an answer here:

I am trying to install Anaconda on my Linux machine. Right or wrong, at the end of the instructions they say to

add this line to the file .bashrc in your home directory: export PATH="/home/username/anaconda/bin:$PATH"

I do not know much of how the PATH in bash works. But, I have another PATH in my .bashrc file:

export PATH="/usr/local/share/rsi/idl/bin:$PATH"

How am I supposed to add the new path?

marked as duplicate by Gilles, Kusalananda, GAD3R, don_crissti, derobert Jan 13 '17 at 22:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


This should be it (all paths wanted in ${PATH} separated by colons) :

export PATH="/usr/local/share/rsi/idl/bin:/home/username/anaconda/bin:$PATH"

You can do multiple path export, In single line,

export PATH=${PATH}:/first/path:/second/path:/third/path

Multiple paths as

export PATH="A"
export PATH="B:$PATH"
export PATH="C:$PATH"
  • Thanks. You are the only one who suggests {PATH}. Why is that different? – Py-ser Feb 9 '16 at 10:57
  • Read as ${path} - it will append the previously defined or other exported paths as well! – KKD Feb 9 '16 at 11:15

One option is to just add the line, so that you have two lines changing the path:

export PATH="/home/username/anaconda/bin:$PATH"
export PATH="/usr/local/share/rsi/idl/bin:$PATH"    

The other option is to just change the existing line to this:

export PATH="/home/username/anaconda/bin:/usr/local/share/rsi/idl/bin:$PATH"

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