133

$ $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.

Community
  • 1
  • 1
Karoh
  • 2,390
  • 3
  • 23
  • 29

5 Answers5

208

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.

HeatfanJohn
  • 7,143
  • 2
  • 35
  • 41
  • Thank you. I would greatly appreciate if you could checkout the other question listed. But thanks for the clarification on $PATH. – Karoh Jan 31 '13 at 02:00
  • 1
    It's worth noting that the string that is returned from `echo $PATH` (or, in this case, just `$PATH`) acts more like an array, where each colon ("`:`") is a separator between each entry. It's helpful to imagine a space (or, a new line) at each `:`. – CalamityAdam Apr 21 '21 at 20:15
44

By entering $PATH on its own at the command prompt, you're trying to run it. This isn't like Windows where you can get your path output by simply typing path.

If you want to see what the path is, simply echo it:

echo $PATH
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
39

To list out the paths as individual lines, you could use: echo "${PATH//:/\n}"

Temi Fakunle
  • 672
  • 6
  • 7
3

Use the command:

 echo $PATH

and you will see all path:

/Users/name/.rvm/gems/ruby-2.5.1@pe/bin:/Users/name/.rvm/gems/ruby-2.5.1@global/bin:/Users/sasha/.rvm/rubies/ruby-2.5.1/bin:/Users/sasha/.rvm/bin:

AlexSh
  • 1,468
  • 15
  • 12
-2

for MacOS, make sure you know where the GO install

export GOPATH=/usr/local/go
PATH=$PATH:$GOPATH/bin
Lam Do
  • 520
  • 4
  • 12