1

I need to add a new directory to my PATH so that SublimeText can find it. I assume this should be added to either .bash_profile, .bashrc, or .profile.

Which one should I add it to?

.bash_profile already has:

export PATH="/home/josh/.rvm/gems/ruby-2.1.5/bin:/home/josh/.rvm/gems/ruby-2.2.0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

in it.

.bashrc and .profile both have:

export PATH="$PATH:$HOME/.rvm/bin"

in them.

Should I have all of these in just one of the files and do multiple 'export' statements just get chained together when processed, even if from different files?

  • From the other questions asnwer: `From the bash man page:

    When bash is invoked as an interactive login shell, ... it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.` That seems to imply that only the first one that it can read will be read. Is that the case? If so, does that mean I should move all of the export PATH lines to .profile or they won't be read?

    – Josh Kesling Jan 18 '15 at 23:12

1 Answers1

-1

if you look inside .bashrc file there is line like this:

# Put your fun stuff here.

... or something like that.

So, this is the place reserved for user declarations, export, alias, etc ... the practice is to put all your export PATH="..." there, in .bashrc file after mentioned comment or just at the end of file.