Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The PATH environment variable contains a list of folder paths in which to look for executables:

/__w/rust/rust/node_modules/.bin:/__w/rust/rust/notebooks/node_modules/.bin:/__w/rust/rust/node_modules/.bin:/__w/rust/node_modules/.bin:/__w/node_modules/.bin:/node_modules/.bin:/usr/share/nodejs/@npmcli/run-script/lib/node-gyp-bin:/__w/rust/rust/venv/bin:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

If an application we want to run has not its folder listed inside PATH, we cannot run it, unless we specify the path to find it.

In order to show an example, we will create a shell script and put inside a subfolder.

Here is the creation of the sub-folder:

And the script creation:

We now make the script executable:

The script is in the following location:

bash: exa: command not found
Fetching long content....

And its content is correct:

However, if we try to run it by its name, the shell complains that it cannot find it:

This is because the shell does not know where to find the script. We can only run it if we specify explicitly the path to find it:

To make it findable by the shell, we need to add its folder to the PATH variable:

Then, by looking in each folder of the PATH environment variable, the shell is able to find the script:

Unfortunately, the modification of the PATH we have just done is only valid for the current shell session. If we open a new session, we will have to do the same modification again. To avoid this, we need to set the PATH modification inside the $HOME/.bash_profile configuration file for bash. Edit or create the file $HOME/.bash_profile and append the following line:

The next time we log in, the file will be read and the PATH modified. For now, we only have to source the file explicitly in order to get the modification:

source $HOME/.bash_profile