Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash - Adding a new PATH on macOS

Example

Manually

(edit ~/.bash_profile and append)

# Setting PATH for something
PATH="/new/dir/location/bin:${PATH}"
export PATH

Terminal

echo "export PATH=/new/dir/location/bin:$PATH" >> ~/.bash_profile


Then reload the profile

source ~/.bash_profile

Note

This reloads your bash profile in the current tab or session. Either you enter this command on every tab or session, or restart Terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment