Reputation: 3549
echo $PATH shows:
/usr/local/bin:/opt/local/bin:/opt/local/sbin://anaconda/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/stefankaros/bin/FDK/Tools/osx
my ~/.bash_profile is:
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# added by Anaconda 2.0.1 installer
export PATH="//anaconda/bin:$PATH"
# Initialization for FDK command line tools.Tue Oct 7 20:01:15 2014
FDK_EXE="/Users/stefankaros/bin/FDK/Tools/osx"
PATH=${PATH}:"/Users/stefankaros/bin/FDK/Tools/osx"
export PATH
export FDK_EXE
# MacPorts Installer addition on 2014-10-22_at_21:44:05: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
export PATH=/usr/local/bin:$PATH
I do not have .bashrc or any other file that starts with .bash in my home dir. in my PATH,where does the opt/x11/bin come from? why is use/bin duplicated? In my .bash_profile, what does export FDK_exe do? PATH was just exported in the line before?
Upvotes: 1
Views: 1600
Reputation: 753455
On Mac OS X, there is a file /etc/paths
which contains (on my Yosemite machine):
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
These are the elements on your PATH that you don't set explicitly in your .bash_profile
. There's also a directory /etc/paths.d
but that's empty on my machine. See also man path_helper
and /usr/libexec/path_helper
, called from /etc/profile
.
You could clean up your PATH to remove duplicate elements. See How to keep from duplicating PATH variable in csh
— which has relevant answers even if you use Bourne shell derivatives.
Upvotes: 1