Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

2 Answers 2

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.

http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html#Bash-Startup-Files

share|improve this answer

Your Answer

 
discard

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.