Skip to content

Instantly share code, notes, and snippets.

@youandhubris
Created April 13, 2018 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youandhubris/33ba4818fd32c220ef731c7aa59b38c4 to your computer and use it in GitHub Desktop.
Save youandhubris/33ba4818fd32c220ef731c7aa59b38c4 to your computer and use it in GitHub Desktop.
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