Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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'm using OSX Mountain Lion 10.8.2

$echo $PATH prints this:


I've commented out everything in ~/.bash_profile and ~/.bashrc and restarted the computer, but the last part in the $PATH variable(/Users/myusername/.rvm/bin) does not go away.

How can I find out where that last part gets added to my $PATH variable?

share|improve this question
Did you restart current shell after changes in config files? – rush Mar 20 '13 at 9:30
yes, I've restarted the Terminal. – Yeonho Mar 20 '13 at 9:31
up vote 4 down vote accepted

man bash's INVOCATION section explains which files are involved in starting an interactive login shell session:

  • /etc/profile
  • ~/.bash_profile
  • ~/.bash_login
  • ~/.profile

Any of these could contain this assignment or a source / . statement to source another script which contains this assignment. Since you've already checked the last two, try looking into the first two and any files that any of these source. This typically includes /etc/profile.d/*, which often contains application-specific PATH assignments.

In my specific case (Ubuntu 12.10) these four files source the following:

  • /etc/profile:
    • /etc/bash.bashrc
    • /etc/profile.d/*.sh
  • ~/.bash_profile doesn't exist
  • ~/.bash_login doesn't exist
  • ~/.profile:
    • $HOME/.bashrc

RVM specifically requests that you source its RC file in ~/.bash_profile for a single user installation, so that's probably a good bet.

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.