Updating $PATH with a new binaries folder

?
S
Bash

This snippet shows how to set $PATH the proper way. MacOS

1# Sanity check
2echo $PATH
3echo $HOME
4
5# Create bin folder
6mkdir $HOME/bin/
7
8# Update Path
9export PATH=$HOME/bin:$PATH
10export PATH=~/bin:$PATH 
11
12# Add $HOME/bin to your PATH environment variable.
13echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile
14echo 'export PATH=$HOME/bin:$PATH' >> ~/.zshrc
15
16# Check if a location is on $PATH
17echo $PATH | grep ~/bin

Created on 7/9/2018