Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 a xterm with the bash shell in linux. When I echo $PATH, it is showing a directory and I want to know who put this directory in the PATH. How can I find out?


share|improve this question

Assuming your login shell is bash, you could start looking in the following files: /etc/profile, ~/.bashrc and ~/.bash_profile. If you invoke bash from another shell, then you might need to check what variables the other shell sets.

share|improve this answer

You probably cannot discover who, but you can find out which file is setting that. Look a the Bash documentation for the startup files. There are several that bash processes on startup to set $PATH and the other environment variables.

share|improve this answer

Also you could take a look to the file /etc/environment

share|improve this answer
It isn't clear how this answers the question. – fixer1234 Apr 14 at 21:00

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.