Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to set the PATH on /etc/paths without the need to reboot your Mac? I know I can do it using an alias but it's not permanent.

For example, I want to set the PATH for MySQL.

share|improve this question

migrated from stackoverflow.com Oct 11 '11 at 5:43

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

4 Answers 4

I assume you want the PATH variable to be set in your terminal environment. If you are using bash (default on Mac OS X) you can add

export PATH=${PATH}:/your/path/to/mysql

to your .bashrc file in the home directory

share|improve this answer

It is not possible to update the system-wide path.

You can execute the line specified by @Matteo though (without needing to add to .bashrc / .bash_profile) and then launch all applications from Terminal. They will inherit the modified $PATH value.

share|improve this answer

Why can't you set the path in /etc/bashrc? Seems like this would be system-wide.

share|improve this answer
This should be a comment, not an answer. –  wizlog Jan 8 '12 at 21:46
@wizlog users with <50 rep can't leave a comment. –  nhinkle Jan 8 '12 at 22:41
@nhinkle can they suggest comments? –  wizlog Jan 9 '12 at 18:57
@wizlog no... that would be way overcomplicating things. –  nhinkle Jan 9 '12 at 22:22

Straightforward way to edit PATH env variable for Terminal mode:

(This is just a different way to do what is mentioned above in case you don't have R/W permission, as I did not)

Navigate to the /private/etc/paths in Finder, r-click, Get Info, Select Sharing & Permissions, change Everyone to Read & Write, edit and save the file (append the new path to the end of the list), then restore the permissions if necessary.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.