In my sample, my directory is /cmd.
2. Go to user directory ~, add the following line into .bash_profile or .zshrc if you have installed oh my zsh:
export PATH="/path/to/the/cmd/directory:$PATH"
In my sample, the line will be export PATH="/cmd:$PATH".
source ~/.bash_profile or source ~/.zshrc.