Back to Developer Roadmap

Command Path in Shell

src/data/roadmaps/linux/content/[email protected]

4.0970 B
Original Source

Command Path in Shell

The command path is a variable that is used by the shell to determine where to look for the executable files to run. Linux commands are nothing but programs residing in particular directories. But, one does not have to navigate to these directories every time to run these programs. The command path comes to the rescue!

Usually, when you type a command in the terminal, the shell needs to know the absolute path of the command's executable to run it. Instead of typing the full path each time, command paths allow the shell to automatically search the indicated directories in the correct order. These paths are stored in the $PATH environment variable.

Visit the following resources to learn more: