From the course: Linux Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Exploring the PATH variable

Exploring the PATH variable - Linux Tutorial

From the course: Linux Tips

Exploring the PATH variable

- [Narrator] The PATH environment variable contains a list of directories a shell will search to find the name of a program typed at the command line. On a Linux system, tools we use are commonly located in various directories and remembering where each of them lives can be tedious. The PATH variable can be set system-wide in a global shell configuration and can also be set or modified by user shell configurations, and because this varies by shell and even by the type of shell, in this episode I'll focus on setting PATH for an interactive Bash shell. PATH can also be set for non-interactive shells and for graphical shells. First, let's take a look at PATH with echo PATH. Here, I can see the directories already included in the variable which will be read from left to right. So if you type a command then there's a program that matches that in both bin and sbin for example, the one in sbin will run and the one in bin will…

Contents