Analyze. Act. Achieve.
Kurinchilion KURINCHILION Analyze. Act. Achieve.

Articles

Linux: Path settings

$PATH is the environment variable related to Linux Path settings.

To add a directory to the path, type $ export PATH=$PATH:/tmp/myshells

The above change is in effect only in the shell from where it is being called

To set the PATH for a specific user, type the below 2 lines in the user's .bash_profile file ($HOME/.bash_profile).

PATH=$PATH:/tmp/myshells export PATH

To set the PATH for ALL users except the root user, type the following line in /etc/profile export PATH=$PATH:/tmp/myshells

Root user is not affected by any setting changes under /etc/profile. To set the path for the root user, we need to modify the root users' .bash_profile (/root/.bash_profile)