What Is $PATH in Linux?
As was already established, the Linux shell will refer to the folders listed in the $PATH environment variable when it receives a command or an exec call from a program. The $PATH variable typically contains the directories /bin, /usr/bin, and /usr/local/bin, with superuser receiving two additional entries, namely /sbin and /usr/sbin. To simply start scripts and programs from the terminal regardless of the current working directory, you can add additional entries to your $PATH variable.
To see the current PATH setting:
echo $PATH
How To Set $PATH Permanently in Linux
An essential part of Linux and other Unix-like operating systems is the $PATH variable. It instructs the shell where to look for these executable files and specifies a list of directories that house various executables on the system. The folders in $PATH on a brand-new Linux installation ensure that most of the programs you run function flawlessly. On your system, you might occasionally want to quickly run customized scripts or apps. In these circumstances, you must adequately specify the $PATH variable before executing those apps.
Contact Us