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
easiest 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.
/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.