PATH

An environment variable holding a list of folders the shell searches, in order, to find the program for a command you type.

In more detail

The first folder containing a match wins, so order decides which version of a program runs when several are installed. On Linux and macOS the entries are separated by colons, and on Windows by semicolons. The current directory is normally not on PATH on Linux and macOS, which is why you run a local script as ./script.sh.

Examples

echo "$PATH"
echo $PATH
In Terraform: If the folder holding the terraform binary is not on your PATH, typing terraform gives a command not found error. That means the install is incomplete, not that anything is broken. Package managers and version managers add the right folder for you.

Related terms

Taught in

References

Certification courses