Reputation:
When I echo $PATH in UNIX I get this:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/apache-maven/apache-maven-3.3.9/apache-maven-3.3.9/bin
Is there a way to find where
/usr/local/apache-maven/apache-maven-3.3.9/apache-maven-3.3.9/bin
was set? I don't remember setting that.
I checked .profile, .bashrc, and .bash_profile and didn't see any PATH declarations in any of them. So how do I find where someone put it?
EDIT: relevant output of "bash -x -l"
+ '[' -x /usr/libexec/path_helper ']'
++ /usr/libexec/path_helper -s
+ eval 'PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/apache-maven/apache-maven-3.3.9/apache-maven-3.3.9/bin:/Applications/dev/Apache-Derby/db-derby-10.12.1.1-bin/bin";' export 'PATH;'
++ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/apache-maven/apache-maven-3.3.9/apache-maven-3.3.9/bin:/Applications/dev/Apache-Derby/db-derby-10.12.1.1-bin/bin
++ export PATH
Upvotes: 3
Views: 402
Reputation: 2883
man bash
lists
As the files it reads on startup. PATH will be modified in one of those, in a file referenced in one of those (or referenced in a file referenced...), or will be set for the login process before your shell is started.
Upvotes: 2
Reputation: 531155
Start your shell with the -x
option; the output will show each command that is executed, which includes the source
/.
commands that will show you which files are sourced. You'll be able to identify file contains the assignment to PATH
of interest.
Upvotes: 5