Tommy Nicholas
Tommy Nicholas

Reputation: 1173

How do I see my $PATH on Mac

I've been struggling with "PATH" issues while setting up Rails and other things on Mac for a long time now, and I can't get a straight answer about how I can just see my $PATH and change it. I'm just running the Terminal right now, but if I need to run another program to run Bash commands or something I can probably figure out how to do that.

Upvotes: 4

Views: 21281

Answers (3)

Gergo Erdosi
Gergo Erdosi

Reputation: 42028

Execute the following command in Terminal to view the current value of PATH:

echo $PATH

To modify this PATH variable, create a .bash_profile file in your home directory (/Users/username/.bash_profile) and add a line similar to this:

export PATH=$PATH:/new/directory/location

Upvotes: 7

cvibha
cvibha

Reputation: 713

type:

echo $PATH

You can check your .bash_profile file and edit $PATH variable there. If that file does not exists then you can create a new one and you can export PATH there using:

export PATH=/usr/local/bin:/usr/local/mysql/bin:$PATH

Upvotes: 0

Greg Hewgill
Greg Hewgill

Reputation: 992707

To see your current PATH,

echo $PATH

in a Terminal window.

Upvotes: 3

Related Questions