Search code examples
macosbashpathenvironment-variableshomebrew

How can I see the current value of my $PATH variable on OS X?


$ $PATH

returns:

-bash: /usr/local/share/npm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/sbin:~/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin: No such file or directory

This seems quite ugly and might be giving me issues with getting Homebrew up and running as well.


Solution

  • You need to use the command echo $PATH to display the PATH variable or you can just execute set or env to display all of your environment variables.

    By typing $PATH you tried to run your PATH variable contents as a command name.

    Bash displayed the contents of your path any way. Based on your output the following directories will be searched in the following order:

    /usr/local/share/npm/bin
    /Library/Frameworks/Python.framework/Versions/2.7/bin
    /usr/local/bin
    /usr/local/sbin
    ~/bin
    /Library/Frameworks/Python.framework/Versions/Current/bin
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    /usr/local/bin
    /opt/X11/bin
    /usr/local/git/bin
    

    To me this list appears to be complete.