Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Possible Duplicate:
Reset your PATH variable

Everytime I open Terminal I need to set the PATH using:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

Otherwise commands like 'ls' do not work. This is a pain. How do you fix the PATH so that each time you open the Terminal you don't need to set the PATH?

share|improve this question

migrated from stackoverflow.com Aug 29 '12 at 14:12

This question came from our site for professional and enthusiast programmers.

marked as duplicate by bmike Sep 17 '12 at 18:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
If you need to do this every time, something is broken. –  You Aug 28 '12 at 13:00

2 Answers 2

You can do this by editing the .profile file in your home directory - just add your PATH command into there and it will be executed each time you open a Terminal window.

You can read about some other ways to do this in this question.

share|improve this answer

One good way is to set your environment variables in /etc/launchd.conf, as shown here. Putting them in launchd.conf makes them accessible in the terminal as well as in any code you may write which uses the environment settings.

share|improve this answer