The $PATH environment variable stores a list of directories where shell programs are defined (e.g. cat, echo, cp, mv). When a shell program is run (i.e. $ cat a_file), the program definition is searched for in each of the directories specified in the $PATH environment variable.
Each directory in the $PATH environment variable is separated with a colon (:)
$ echo $PATH # => /usr/bin:/bin:/usr/sbin
To print each path on a separate line, use the following command:
$ echo $PATH | tr ":" "\n"
To add the ~/Desktop/example/bin directory to $PATH, run the following command:
Recall that $PATH is a list of directories delimited with a colon. In the previous command, the PATH environment variable is reset to the previous value of PATH (i.e. $PATH) followed by the new directory that is being added to PATH. The $HOME environment variable is set to the value of the home directory.