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)

Share it onShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
Shell Scripting: Saving Shell scripts

For example, if we have shell script named "myshellscript.sh" (with execute permission) we can make it run in the current...

Close