Bash PATH Variable
The PATH variable is a list of folders, separated by :. When you type a command, Bash looks for it in these folders, in order.
To run your own scripts from anywhere, add their folder to the end of PATH. Keep $PATH in the new value, or the normal commands will be lost.
Add a folder to PATH
The folder ~/bin has an executable script called greet:
PATH="$PATH:$HOME/bin"
greet
Hello from greet
Find where a command lives
type -t greet
file
type cd
cd is a shell builtin