Linux PATH variable settings, linuxpath variable
In general Linux, there are two configuration files that can be used to set the PATH variable, one:. bashrc two:. bash_profile; there is also a way to temporarily set the PATH variable (3)
1. Edit. bashrc and add export PATH = $ PATH:/home/myname/mydirectory. This is to keep the PATH behind the existing PATH. Or:
Export PATH =/home/myname/mydirectory: $ PATH this is to put the PATH at the beginning.
2. Enter the source. bashrc command in bash.
2. 1. Edit. bash_profile and add export PATH = $ PATH:/home/myname/mydirectory. To put the PATH in front of "reference 1.
2. log out of the user and log on again to activate the function.
3. In this shell session, use the custom PATH, export PATH = $ PATH:/home/myname/mydirectory to close the shell and no longer activate this PATH configuration.
Conclusion: After all the paths are set, run the following command to view the PATH: echo $ PATH