

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Compiled vs. Interpreted
incomplete
2: Executables
incomplete
3: Shebang
incomplete
4: Bourne Shell
incomplete
5: Environment Variables
incomplete
6: PATH
incomplete
7: Change Your PATH
incomplete
This lesson's interactive features are locked, please to keep using them
A common problem you'll run into when installing programs via the terminal is that after installing, you try to run the program and get an error like this:
$ my-new-program
-bash: my-new-program: command not found
Nine times out of ten, it's because the program is installed in a directory that's not in your PATH variable. Oftentimes when you install a program using the CLI, it will print a message during the installation process that tells you where the executable was installed. Don't let your eyes glaze over when your terminal prints important messages! Sometimes you just gotta rtfm.
To add a directory to your PATH without overwriting all of the existing directories, use the export command and reference the existing PATH variable:
export PATH="$PATH:/some/new/directory"
The $PATH part is a reference to the existing PATH variable. The : separates the existing directories from the new directory that you're adding.
The worldbanc/private/bin directory has some handy scripts. Let's add it to your PATH so that your shell can find them by name from anywhere, without typing out the full path each time.
Submit the shell checks.
This change only lasts for your current shell session. In Part Two, once you're on your own
machine, you'll learn how to make a PATH change permanent.