path environment variable

Joined
Oct 27, 2004
Messages
49
Reaction score
0
Points
6
How do I view my path environment variable in mac OS x? I am trying to install a development tool and the location should now be in the path but I want to see it to make sure.

Thanks!
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
You can type set or env in the Terminal. They show slightly different things but both show PATH.
Also you can 'echo $PATH'.
Depends on exactly what you're looking for.
 
OP
B
Joined
Oct 27, 2004
Messages
49
Reaction score
0
Points
6
cradom said:
You can type set or env in the Terminal. They show slightly different things but both show PATH.
Also you can 'echo $PATH'.
Depends on exactly what you're looking for.

Thanks,

How do I now add an environment variable and then append to the path?

Thanks!
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
To add something to the path put something like this into .bash_profile or .bashrc:

PATH="/whatever/youneed/toadd:${PATH}"
export PATH

For example:
PATH="/usr/local/bin:${PATH}"
or
PATH="~/craig/bin:/Volumes/HD3/downloads:${PATH}"

After you add this restart Terminal.
 
Joined
Jan 26, 2013
Messages
3
Reaction score
0
Points
1
Thanks cradom I found this post useful. Would you mind explaining the difference between doing this and editing the /private/etc/path file is? I was told by another mac owner to make my change there to resolve a problem I was having with homebrew. My new mac doesn't have a .bash_profile or .bashrc file like my work mac does. I appreciate any help I can get here. Thanks.

looking to resolve homebrew warnings about the order of /usr/bin and /usr/local/bin
 
C

chas_m

Guest
With respect, this thread might be much better suited to the "OS X - Operating System" forum or even the "OS X - Development and Darwin" forum, where you are likely to get more people helping than in "Switcher's Hangout," which is normally about helping PC buyers choose and learn their first Mac.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top