How To Edit Your PATH Environment Variables On Mac OS X

by Ben on June 20, 2008

If you are new to Mac OS X, you may need to know how to edit your PATH. The good news is that this is an extremely easy task on Mac OS X.

Step 1: Open up a Terminal windows (this is in your Applications/Utilites folder by default)

Step 2: Enter the follow command:

$ sudo vi /etc/paths

This will open the paths file in vi (a simple command line file editor included on your system).

Step 3: Edit the contents of your PATH file by putting each path you want included on a separate line.

Step 4: Save the contents of your PATH file by pressing SHIFT + Z twice.

That’s it! Now you know how to edit the PATH on your Mac OS X computer system.

{ 2 trackbacks }

Hello World in Adobe Air - Amr ElGarhy
April 14, 2009 at 9:12 pm
AIR: desarrollando y probando nuestras aplicaciones
August 18, 2009 at 5:02 pm

{ 3 comments… read them below or add one }

1 Keir Briscoe July 18, 2008 at 5:04 pm

I am able to open my path using the above command. But I am not able to add any lines or change any existing ones. What do I have to do to get into Edit mode?

2 Ben Hathaway July 18, 2008 at 6:14 pm

You can refer to vi editor commands for help with the specifics of using vi to edit files. To switch into edit mode though, you should be able to press “a” once and then ESC will get you out of edit mode. Then press “ZZ” to save the file.

3 Keir Briscoe July 18, 2008 at 6:22 pm

Thank you. I found that if I presses “i” I was able to insert a line of text.

Unfortunately my python script will still not run.

Thanks for your reply.

Leave a Comment