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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With