Adding a directory to PATH in bash


Joined
Aug 24, 2006
Messages
2
Reaction score
0
I am trying to add a directory to my PATH in bash (using Tiger OS 10.4.7). A book I have said to edit your ~/.profile file by using the VI editor. Well I can't find .profile. Am I not looking in the right place as I would like to know how to edit my PATH.

Steve
 
Ad

Advertisements

Ric

Joined
May 14, 2004
Messages
4,260
Reaction score
4
Hi there and welcome,

the chances are there isn't a file there already !

Code:
vi ~/.profile
then add in the new path, save and you should be okay.

Let us know if you're not sure !

regards

Ric
 
Joined
Aug 24, 2006
Messages
2
Reaction score
0
Yes, it is not there (.profile). However my question then is how do I edit my PATH? Where is the file to edit it?

Steve
 
Ad

Advertisements

Joined
Nov 13, 2007
Messages
1
Reaction score
0
in the terminal, in your home directory, type:
echo $PATH (to see the path, case sensitive)

to add to path, edit .profile using vi, pico or nano in the terminal, e.g.:
nano .profile (to create and/or edit the file)
PATH-$PATH:/Developer/Tools; export PATH (example to add the dev tools to path)
then save and exit using ^x (control-x)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top