In the last screen, we typed /usr/bin/python
to access the Python interpreter. If the Python interpreter is at that location, how come we can also access it by typing python
? We can do this because of the PATH
variable. The PATH
environment variable contains several folders. Any program in any one of these folders can be run simply by typing the name of the program. Since/usr/bin
is one of the folders in PATH
, we can access python
, which is in the folder, by just typing python
instead of the full path.
Instructions
- Type
echo $PATH
to see what folders are inPATH
.
/home/dq$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin