141
92
I type echo $PATH
on the command line and get
/opt/local/bin:/opt/local/sbin:/Users/andrew/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/pear/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin
I'm wondering where this is getting set since my .bash_login
file is empty.
I'm particularly concerned that, after installing MacPorts, it installed a bunch of junk in /opt
. I don't think that directory even exists in a normal Mac OS X install.
Update: Thanks to jtimberman for correcting my echo $PATH
statement
I have made a script mostly based on this post, that quickly prints out where the PATH is defined along these multiple locations: https://gist.github.com/lopespm/6407349952bc8a1ff8fb
– Pedro Lopes – 2016-02-16T01:50:10.7635
comment from SMcCandlish:
– Sathyajith Bhat – 2011-10-03T10:11:20.757easiest solution when you want to make a site-wide path change (e.g. to include /usr/libexec or whatever) is to edit
/etc/paths
. While the new
/etc/paths.d/
thing is functional, it's actually more hassle than maintaining a single file. As others have hinted but not spelled out, if the path changes you want would be useful only for one user, it's best to make that change in the bash and/or tcsh config files in that user's home directory instead of system-wide.
@Sathya, It seems to me
/etc/paths.d
is useful for installation scripts. If I want my installation script to add the installed program to the path, I can drop a file in/etc/paths.d
. If I want to edit the path manually,/etc/paths
is a better option. – haydenmuhl – 2012-12-06T01:04:52.853